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

Function wallet_inflight_save

wallet/wallet.c:1066–1089  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1064}
1065
1066void wallet_inflight_save(struct wallet *w,
1067 struct channel_inflight *inflight)
1068{
1069 struct db_stmt *stmt;
1070 /* The *only* thing you can update on an
1071 * inflight is the funding PSBT (to add sigs)
1072 * ((and maybe later the last_tx/last_sig if this is for
1073 * a splice */
1074 stmt = db_prepare_v2(w->db,
1075 SQL("UPDATE channel_funding_inflights SET"
1076 " funding_psbt=?" // 0
1077 ", funding_tx_remote_sigs_received=?" // 1
1078 " WHERE"
1079 " channel_id=?" // 2
1080 " AND funding_tx_id=?" // 3
1081 " AND funding_tx_outnum=?")); // 4
1082 db_bind_psbt(stmt, 0, inflight->funding_psbt);
1083 db_bind_int(stmt, 1, inflight->remote_tx_sigs);
1084 db_bind_u64(stmt, 2, inflight->channel->dbid);
1085 db_bind_txid(stmt, 3, &inflight->funding->outpoint.txid);
1086 db_bind_int(stmt, 4, inflight->funding->outpoint.n);
1087
1088 db_exec_prepared_v2(take(stmt));
1089}
1090
1091void wallet_channel_clear_inflights(struct wallet *w,
1092 struct channel *chan)

Callers 5

wallet_channel_saveFunction · 0.85
handle_peer_tx_sigs_sentFunction · 0.85
handle_peer_tx_sigs_msgFunction · 0.85
json_openchannel_signedFunction · 0.85

Calls 5

db_bind_psbtFunction · 0.85
db_bind_intFunction · 0.85
db_bind_u64Function · 0.85
db_bind_txidFunction · 0.85
db_exec_prepared_v2Function · 0.85

Tested by

no test coverage detected