mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-30 03:04:21 +01:00
wallet: Reserve UTXOs used in build_utxos
This commit is contained in:
committed by
Rusty Russell
parent
19a4e7f542
commit
bdb6b1002f
@@ -179,7 +179,12 @@ static void unreserve_utxo(struct lightningd *ld, const struct utxo *unres)
|
||||
{
|
||||
struct tracked_utxo *utxo;
|
||||
|
||||
list_for_each(&ld->utxos, utxo, list) {
|
||||
assert(wallet_update_output_status(ld->wallet, &unres->txid,
|
||||
unres->outnum, output_state_reserved,
|
||||
output_state_available));
|
||||
|
||||
list_for_each(&ld->utxos, utxo, list)
|
||||
{
|
||||
if (unres != &utxo->utxo)
|
||||
continue;
|
||||
assert(utxo->reserved);
|
||||
@@ -225,6 +230,10 @@ const struct utxo **build_utxos(const tal_t *ctx,
|
||||
utxos[i] = &utxo->utxo;
|
||||
utxo->reserved = true;
|
||||
|
||||
assert(wallet_update_output_status(
|
||||
ld->wallet, &utxo->utxo.txid, utxo->utxo.outnum,
|
||||
output_state_available, output_state_reserved));
|
||||
|
||||
/* Add this input's weight. */
|
||||
weight += (32 + 4 + 4) * 4;
|
||||
if (utxos[i]->is_p2sh)
|
||||
|
||||
Reference in New Issue
Block a user