Browse Source

wallet: Track available outputs

We'd like to use the database as the unique source of truth, to
avoid having to synchronize multiple versions.
ppa-0.6.1
Christian Decker 8 years ago
committed by Rusty Russell
parent
commit
ca30c8c0cc
  1. 5
      lightningd/build_utxos.c

5
lightningd/build_utxos.c

@ -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++;

Loading…
Cancel
Save