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

Function wallet_penalty_base_add

wallet/wallet.c:4874–4894  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4872}
4873
4874void wallet_penalty_base_add(struct wallet *w, u64 chan_id,
4875 const struct penalty_base *pb)
4876{
4877 struct db_stmt *stmt;
4878 stmt = db_prepare_v2(w->db,
4879 SQL("INSERT INTO penalty_bases ("
4880 " channel_id"
4881 ", commitnum"
4882 ", txid"
4883 ", outnum"
4884 ", amount"
4885 ") VALUES (?, ?, ?, ?, ?);"));
4886
4887 db_bind_u64(stmt, 0, chan_id);
4888 db_bind_u64(stmt, 1, pb->commitment_num);
4889 db_bind_txid(stmt, 2, &pb->txid);
4890 db_bind_int(stmt, 3, pb->outnum);
4891 db_bind_amount_sat(stmt, 4, &pb->amount);
4892
4893 db_exec_prepared_v2(take(stmt));
4894}
4895
4896struct penalty_base *wallet_penalty_base_load_for_channel(const tal_t *ctx,
4897 struct wallet *w,

Callers 4

handle_commit_receivedFunction · 0.85
opening_funder_finishedFunction · 0.85
opening_fundee_finishedFunction · 0.85
peer_sending_commitsigFunction · 0.85

Calls 5

db_bind_u64Function · 0.85
db_bind_txidFunction · 0.85
db_bind_intFunction · 0.85
db_bind_amount_satFunction · 0.85
db_exec_prepared_v2Function · 0.85

Tested by

no test coverage detected