mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 05:12:45 +01:00
wallet: Mark utxo outpoints as spent
Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
parent
50a8e32e3f
commit
8958a082ec
@ -1815,6 +1815,20 @@ void wallet_outpoint_spend(struct wallet *w, const u32 blockheight,
|
||||
|
||||
db_exec_prepared(w->db, stmt);
|
||||
}
|
||||
|
||||
if (outpointfilter_matches(w->utxoset_outpoints, txid, outnum)) {
|
||||
stmt = db_prepare(w->db,
|
||||
"UPDATE utxoset "
|
||||
"SET spendheight = ? "
|
||||
"WHERE txid = ?"
|
||||
" AND outnum = ?");
|
||||
|
||||
sqlite3_bind_int(stmt, 1, blockheight);
|
||||
sqlite3_bind_sha256_double(stmt, 2, &txid->shad);
|
||||
sqlite3_bind_int(stmt, 3, outnum);
|
||||
|
||||
db_exec_prepared(w->db, stmt);
|
||||
}
|
||||
}
|
||||
|
||||
void wallet_utxoset_add(struct wallet *w, const struct bitcoin_tx *tx,
|
||||
|
Loading…
Reference in New Issue
Block a user