Skip to content

Commit 8157e37

Browse files
darosiorniftynei
authored andcommitted
wallet: correct CSV check in deep_enough
Return false if the timelock didn't mature yet, not the other way around. Also, the check shouldn't be strict: if the CSV is 1 it is valid at utxo->blockheight + 1. Signed-off-by: Antoine Poinsot <[email protected]>
1 parent f719343 commit 8157e37

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

wallet/db_postgres_sqlgen.c

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wallet/db_sqlite3_sqlgen.c

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wallet/statements_gettextgen.po

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wallet/wallet.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ static bool deep_enough(u32 maxheight, const struct utxo *utxo,
530530
if (utxo->close_info) {
531531
u32 csv_free = *utxo->blockheight + utxo->close_info->csv;
532532
assert(csv_free > *utxo->blockheight);
533-
if (csv_free < current_blockheight)
533+
if (current_blockheight < csv_free)
534534
return false;
535535
}
536536
return *utxo->blockheight <= maxheight;

0 commit comments

Comments
 (0)