Skip to content

Commit

Permalink
fixup! wallet: explicit routines to reserve/unreserve a UTXO.
Browse files Browse the repository at this point in the history
  • Loading branch information
rustyrussell committed Jul 14, 2020
1 parent 85a8b70 commit 01672a9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions wallet/wallet.c
Original file line number Diff line number Diff line change
Expand Up @@ -480,9 +480,12 @@ bool wallet_reserve_utxo(struct wallet *w, struct utxo *utxo, u32 current_height

void wallet_unreserve_utxo(struct wallet *w, struct utxo *utxo, u32 current_height)
{
if (utxo->status == output_state_reserved)
if (utxo->status == output_state_reserved) {
/* FIXME: old code didn't set reserved_til, so fake it here */
if (!utxo->reserved_til)
utxo->reserved_til = tal_dup(utxo, u32, &current_height);
assert(utxo->reserved_til);
else
} else
assert(!utxo->reserved_til);

if (utxo->status != output_state_reserved)
Expand Down

0 comments on commit 01672a9

Please sign in to comment.