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

Function db_set_utxo

wallet/wallet.c:713–730  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

711}
712
713static void db_set_utxo(struct db *db, const struct utxo *utxo)
714{
715 struct db_stmt *stmt;
716
717 if (utxo->status == OUTPUT_STATE_RESERVED)
718 assert(utxo->reserved_til);
719 else
720 assert(!utxo->reserved_til);
721
722 stmt = db_prepare_v2(
723 db, SQL("UPDATE outputs SET status=?, reserved_til=? "
724 "WHERE prev_out_tx=? AND prev_out_index=?"));
725 db_bind_int(stmt, output_status_in_db(utxo->status));
726 db_bind_int(stmt, utxo->reserved_til);
727 db_bind_txid(stmt, &utxo->outpoint.txid);
728 db_bind_int(stmt, utxo->outpoint.n);
729 db_exec_prepared_v2(take(stmt));
730}
731
732bool wallet_reserve_utxo(struct wallet *w, struct utxo *utxo,
733 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