| 1586 | } |
| 1587 | |
| 1588 | void wallet_inflight_save(struct wallet *w, |
| 1589 | struct channel_inflight *inflight) |
| 1590 | { |
| 1591 | struct db_stmt *stmt; |
| 1592 | /* The *only* thing you can update on an |
| 1593 | * inflight is the funding PSBT (to add sigs) |
| 1594 | * and the last_tx/last_sig or locked_scid if this is for a splice */ |
| 1595 | stmt = db_prepare_v2(w->db, |
| 1596 | SQL("UPDATE channel_funding_inflights SET" |
| 1597 | " funding_psbt=?" |
| 1598 | ", funding_tx_remote_sigs_received=?" |
| 1599 | ", last_tx=?" |
| 1600 | ", last_sig=?" |
| 1601 | ", locked_scid=?" |
| 1602 | " WHERE" |
| 1603 | " channel_id=?" |
| 1604 | " AND funding_tx_id=?" |
| 1605 | " AND funding_tx_outnum=?")); |
| 1606 | db_bind_psbt(stmt, inflight->funding_psbt); |
| 1607 | db_bind_int(stmt, inflight->remote_tx_sigs); |
| 1608 | if (inflight->last_tx) { |
| 1609 | db_bind_psbt(stmt, inflight->last_tx->psbt); |
| 1610 | db_bind_signature(stmt, &inflight->last_sig.s); |
| 1611 | } else { |
| 1612 | db_bind_null(stmt); |
| 1613 | db_bind_null(stmt); |
| 1614 | } |
| 1615 | if (inflight->locked_scid) |
| 1616 | db_bind_short_channel_id(stmt, *inflight->locked_scid); |
| 1617 | else |
| 1618 | db_bind_null(stmt); |
| 1619 | db_bind_u64(stmt, inflight->channel->dbid); |
| 1620 | db_bind_txid(stmt, &inflight->funding->outpoint.txid); |
| 1621 | db_bind_int(stmt, inflight->funding->outpoint.n); |
| 1622 | |
| 1623 | db_exec_prepared_v2(take(stmt)); |
| 1624 | } |
| 1625 | |
| 1626 | static struct short_channel_id *db_col_optional_scid(const tal_t *ctx, |
| 1627 | struct db_stmt *stmt, |
no test coverage detected