MCPcopy Create free account
hub / github.com/ElementsProject/lightning / db_set_utxo

Function db_set_utxo

wallet/wallet.c:727–744  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

725}
726
727static void db_set_utxo(struct db *db, const struct utxo *utxo)
728{
729 struct db_stmt *stmt;
730
731 if (utxo->status == OUTPUT_STATE_RESERVED)
732 assert(utxo->reserved_til);
733 else
734 assert(!utxo->reserved_til);
735
736 stmt = db_prepare_v2(
737 db, SQL("UPDATE outputs SET status=?, reserved_til=? "
738 "WHERE prev_out_tx=? AND prev_out_index=?"));
739 db_bind_int(stmt, output_status_in_db(utxo->status));
740 db_bind_int(stmt, utxo->reserved_til);
741 db_bind_txid(stmt, &utxo->outpoint.txid);
742 db_bind_int(stmt, utxo->outpoint.n);
743 db_exec_prepared_v2(take(stmt));
744}
745
746bool wallet_reserve_utxo(struct wallet *w, struct utxo *utxo,
747 u32 current_height,

Callers 2

wallet_reserve_utxoFunction · 0.85
wallet_unreserve_utxoFunction · 0.85

Calls 4

db_bind_intFunction · 0.85
output_status_in_dbFunction · 0.85
db_bind_txidFunction · 0.85
db_exec_prepared_v2Function · 0.85

Tested by

no test coverage detected