mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-15 20:09:18 +01:00
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 <darosior@protonmail.com>
This commit is contained in:
parent
f719343b4e
commit
8157e378f4
4 changed files with 4 additions and 4 deletions
2
wallet/db_postgres_sqlgen.c
generated
2
wallet/db_postgres_sqlgen.c
generated
|
@ -2026,4 +2026,4 @@ struct db_query db_postgres_queries[] = {
|
|||
|
||||
#endif /* LIGHTNINGD_WALLET_GEN_DB_POSTGRES */
|
||||
|
||||
// SHA256STAMP:6353b67b3e4f539da2d1f0c2564c4a8243f07d59cd0b73bc83d5552600bd67f7
|
||||
// SHA256STAMP:27a166e040e517422e91cf7ffbd12426b34337b8d75f82d7aa4c448beae5e821
|
||||
|
|
2
wallet/db_sqlite3_sqlgen.c
generated
2
wallet/db_sqlite3_sqlgen.c
generated
|
@ -2026,4 +2026,4 @@ struct db_query db_sqlite3_queries[] = {
|
|||
|
||||
#endif /* LIGHTNINGD_WALLET_GEN_DB_SQLITE3 */
|
||||
|
||||
// SHA256STAMP:6353b67b3e4f539da2d1f0c2564c4a8243f07d59cd0b73bc83d5552600bd67f7
|
||||
// SHA256STAMP:27a166e040e517422e91cf7ffbd12426b34337b8d75f82d7aa4c448beae5e821
|
||||
|
|
2
wallet/statements_gettextgen.po
generated
2
wallet/statements_gettextgen.po
generated
|
@ -1337,4 +1337,4 @@ msgstr ""
|
|||
#: wallet/test/run-wallet.c:1696
|
||||
msgid "INSERT INTO channels (id) VALUES (1);"
|
||||
msgstr ""
|
||||
# SHA256STAMP:e203d19d9f4192ad6b3aa1a6f257d4f7b267df56c5de9810b573f0affa0122fd
|
||||
# SHA256STAMP:3652b5850f08383c0f0c01a7f11c1a22ec2b4ac16018152d2770a73674fb05ec
|
||||
|
|
|
@ -530,7 +530,7 @@ static bool deep_enough(u32 maxheight, const struct utxo *utxo,
|
|||
if (utxo->close_info) {
|
||||
u32 csv_free = *utxo->blockheight + utxo->close_info->csv;
|
||||
assert(csv_free > *utxo->blockheight);
|
||||
if (csv_free < current_blockheight)
|
||||
if (current_blockheight < csv_free)
|
||||
return false;
|
||||
}
|
||||
return *utxo->blockheight <= maxheight;
|
||||
|
|
Loading…
Add table
Reference in a new issue