mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-23 15:04:19 +01:00
gossip_control: when searching for a txout, make sure it's not spent!
There's no reason for the db to ever return non-NULL if it's spent. And there's only one caller, for which that is definitely true. Suggested-by: @cdecker Fixes: #1934 Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
24c386c086
commit
0855422110
@@ -2139,7 +2139,8 @@ struct outpoint *wallet_outpoint_for_scid(struct wallet *w, tal_t *ctx,
|
||||
"FROM utxoset "
|
||||
"WHERE blockheight = ?"
|
||||
" AND txindex = ?"
|
||||
" AND outnum = ?");
|
||||
" AND outnum = ?"
|
||||
" AND spendheight IS NULL");
|
||||
sqlite3_bind_int(stmt, 1, short_channel_id_blocknum(scid));
|
||||
sqlite3_bind_int(stmt, 2, short_channel_id_txnum(scid));
|
||||
sqlite3_bind_int(stmt, 3, short_channel_id_outnum(scid));
|
||||
|
||||
Reference in New Issue
Block a user