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

Function wallet_htlc_sigs_save

wallet/wallet.c:4728–4746  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4726}
4727
4728void wallet_htlc_sigs_save(struct wallet *w, u64 channel_id,
4729 const struct bitcoin_signature *htlc_sigs)
4730{
4731 /* Clear any existing HTLC sigs for this channel */
4732 struct db_stmt *stmt = db_prepare_v2(
4733 w->db, SQL("DELETE FROM htlc_sigs WHERE channelid = ?"));
4734 db_bind_u64(stmt, channel_id);
4735 db_exec_prepared_v2(take(stmt));
4736
4737 /* Now insert the new ones */
4738 for (size_t i=0; i<tal_count(htlc_sigs); i++) {
4739 stmt = db_prepare_v2(w->db,
4740 SQL("INSERT INTO htlc_sigs (channelid, "
4741 "signature) VALUES (?, ?)"));
4742 db_bind_u64(stmt, channel_id);
4743 db_bind_signature(stmt, &htlc_sigs[i].s);
4744 db_exec_prepared_v2(take(stmt));
4745 }
4746}
4747
4748void wallet_htlc_sigs_add(struct wallet *w, u64 channel_id,
4749 struct bitcoin_outpoint inflight_outpoint,

Callers 1

peer_got_commitsigFunction · 0.85

Calls 3

db_bind_u64Function · 0.85
db_exec_prepared_v2Function · 0.85
db_bind_signatureFunction · 0.85

Tested by

no test coverage detected