mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-07 16:14:26 +01:00
wallet: Track available outputs
We'd like to use the database as the unique source of truth, to avoid having to synchronize multiple versions.
This commit is contained in:
committed by
Rusty Russell
parent
9882a9fb29
commit
ca30c8c0cc
@@ -145,6 +145,11 @@ static void json_addfunds(struct command *cmd,
|
||||
bitcoin_txid(tx, &utxo->utxo.txid);
|
||||
utxo->utxo.outnum = output;
|
||||
utxo->reserved = false;
|
||||
if (!wallet_add_utxo(ld->wallet, &utxo->utxo, p2sh_wpkh)) {
|
||||
command_fail(cmd, "Could add outputs to wallet");
|
||||
tal_free(utxo);
|
||||
return;
|
||||
}
|
||||
list_add_tail(&ld->utxos, &utxo->list);
|
||||
total_satoshi += utxo->utxo.amount;
|
||||
num_utxos++;
|
||||
|
||||
Reference in New Issue
Block a user