@@ -1244,8 +1244,9 @@ void wallet_inflight_add(struct wallet *w, struct channel_inflight *inflight)
12441244 ", i_am_initiator"
12451245 ", force_sign_first"
12461246 ", remote_funding"
1247+ ", locked_onchain"
12471248 ") VALUES ("
1248- "?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);" ));
1249+ "?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? );" ));
12491250
12501251 db_bind_u64 (stmt , inflight -> channel -> dbid );
12511252 db_bind_txid (stmt , & inflight -> funding -> outpoint .txid );
@@ -1288,6 +1289,7 @@ void wallet_inflight_add(struct wallet *w, struct channel_inflight *inflight)
12881289 db_bind_pubkey (stmt , inflight -> funding -> splice_remote_funding );
12891290 else
12901291 db_bind_null (stmt );
1292+ db_bind_int (stmt , inflight -> is_locked );
12911293
12921294 db_exec_prepared_v2 (stmt );
12931295 assert (!stmt -> error );
@@ -1316,17 +1318,18 @@ void wallet_inflight_save(struct wallet *w,
13161318 struct db_stmt * stmt ;
13171319 /* The *only* thing you can update on an
13181320 * inflight is the funding PSBT (to add sigs)
1319- * and the last_tx/last_sig if this is for a splice */
1321+ * and the last_tx/last_sig or locked_onchain if this is for a splice */
13201322 stmt = db_prepare_v2 (w -> db ,
13211323 SQL ("UPDATE channel_funding_inflights SET"
13221324 " funding_psbt=?" // 0
13231325 ", funding_tx_remote_sigs_received=?" // 1
13241326 ", last_tx=?" // 2
13251327 ", last_sig=?" // 3
1328+ ", locked_onchain=?" // 4
13261329 " WHERE"
1327- " channel_id=?" // 4
1328- " AND funding_tx_id=?" // 5
1329- " AND funding_tx_outnum=?" )); // 6
1330+ " channel_id=?" // 5
1331+ " AND funding_tx_id=?" // 6
1332+ " AND funding_tx_outnum=?" )); // 7
13301333 db_bind_psbt (stmt , inflight -> funding_psbt );
13311334 db_bind_int (stmt , inflight -> remote_tx_sigs );
13321335 if (inflight -> last_tx ) {
@@ -1336,6 +1339,7 @@ void wallet_inflight_save(struct wallet *w,
13361339 db_bind_null (stmt );
13371340 db_bind_null (stmt );
13381341 }
1342+ db_bind_int (stmt , inflight -> is_locked );
13391343 db_bind_u64 (stmt , inflight -> channel -> dbid );
13401344 db_bind_txid (stmt , & inflight -> funding -> outpoint .txid );
13411345 db_bind_int (stmt , inflight -> funding -> outpoint .n );
@@ -1434,6 +1438,8 @@ wallet_stmt2inflight(struct wallet *w, struct db_stmt *stmt,
14341438 i_am_initiator ,
14351439 force_sign_first );
14361440
1441+ inflight -> is_locked = db_col_int (stmt , "locked_onchain" );
1442+
14371443 /* last_tx is null for not yet committed
14381444 * channels + static channel backup recoveries */
14391445 if (!db_col_is_null (stmt , "last_tx" )) {
@@ -1485,6 +1491,7 @@ static bool wallet_channel_load_inflights(struct wallet *w,
14851491 ", i_am_initiator"
14861492 ", force_sign_first"
14871493 ", remote_funding"
1494+ ", locked_onchain"
14881495 " FROM channel_funding_inflights"
14891496 " WHERE channel_id = ?"
14901497 " ORDER BY funding_feerate" ));
0 commit comments