Skip to content

Commit 025e8a4

Browse files
committed
wallet: remove now-gratuitous counters from update statements.
When we had to use the number to the db_bind call, these annotations made sense, but since 0bcff1e (for v23.08) we removed that. So remove all the counters, which are simple overhead if we want to change something. Signed-off-by: Rusty Russell <[email protected]>
1 parent 5eb6af5 commit 025e8a4

File tree

1 file changed

+62
-62
lines changed

1 file changed

+62
-62
lines changed

wallet/wallet.c

Lines changed: 62 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1494,15 +1494,15 @@ void wallet_inflight_save(struct wallet *w,
14941494
* and the last_tx/last_sig or locked_scid if this is for a splice */
14951495
stmt = db_prepare_v2(w->db,
14961496
SQL("UPDATE channel_funding_inflights SET"
1497-
" funding_psbt=?" // 0
1498-
", funding_tx_remote_sigs_received=?" // 1
1499-
", last_tx=?" // 2
1500-
", last_sig=?" // 3
1501-
", locked_scid=?" // 4
1497+
" funding_psbt=?"
1498+
", funding_tx_remote_sigs_received=?"
1499+
", last_tx=?"
1500+
", last_sig=?"
1501+
", locked_scid=?"
15021502
" WHERE"
1503-
" channel_id=?" // 5
1504-
" AND funding_tx_id=?" // 6
1505-
" AND funding_tx_outnum=?")); // 7
1503+
" channel_id=?"
1504+
" AND funding_tx_id=?"
1505+
" AND funding_tx_outnum=?"));
15061506
db_bind_psbt(stmt, inflight->funding_psbt);
15071507
db_bind_int(stmt, inflight->remote_tx_sigs);
15081508
if (inflight->last_tx) {
@@ -2519,61 +2519,61 @@ void wallet_channel_save(struct wallet *w, struct channel *chan)
25192519
wallet_channel_config_save(w, &chan->our_config);
25202520

25212521
stmt = db_prepare_v2(w->db, SQL("UPDATE channels SET"
2522-
" shachain_remote_id=?," // 0
2523-
" scid=?," // 1
2524-
" full_channel_id=?," // 2
2525-
" state=?," // 3
2526-
" funder=?," // 4
2527-
" channel_flags=?," // 5
2528-
" minimum_depth=?," // 6
2529-
" next_index_local=?," // 7
2530-
" next_index_remote=?," // 8
2531-
" next_htlc_id=?," // 9
2532-
" funding_tx_id=?," // 10
2533-
" funding_tx_outnum=?," // 11
2534-
" funding_satoshi=?," // 12
2535-
" our_funding_satoshi=?," // 13
2536-
" funding_locked_remote=?," // 14
2537-
" push_msatoshi=?," // 15
2538-
" msatoshi_local=?," // 16
2522+
" shachain_remote_id=?,"
2523+
" scid=?,"
2524+
" full_channel_id=?,"
2525+
" state=?,"
2526+
" funder=?,"
2527+
" channel_flags=?,"
2528+
" minimum_depth=?,"
2529+
" next_index_local=?,"
2530+
" next_index_remote=?,"
2531+
" next_htlc_id=?,"
2532+
" funding_tx_id=?,"
2533+
" funding_tx_outnum=?,"
2534+
" funding_satoshi=?,"
2535+
" our_funding_satoshi=?,"
2536+
" funding_locked_remote=?,"
2537+
" push_msatoshi=?,"
2538+
" msatoshi_local=?,"
25392539
" shutdown_scriptpubkey_remote=?,"
2540-
" shutdown_keyidx_local=?," // 18
2541-
" channel_config_local=?," // 19
2542-
" last_tx=?, last_sig=?," // 20 + 21
2543-
" last_was_revoke=?," // 22
2544-
" min_possible_feerate=?," // 23
2545-
" max_possible_feerate=?," // 24
2546-
" msatoshi_to_us_min=?," // 25
2547-
" msatoshi_to_us_max=?," // 26
2548-
" feerate_base=?," // 27
2549-
" feerate_ppm=?," // 28
2550-
" remote_upfront_shutdown_script=?," // 29
2551-
" local_static_remotekey_start=?," // 30
2552-
" remote_static_remotekey_start=?," // 31
2553-
" channel_type=?," // 32
2554-
" shutdown_scriptpubkey_local=?," // 33
2555-
" closer=?," // 34
2556-
" state_change_reason=?," // 35
2557-
" shutdown_wrong_txid=?," // 36
2558-
" shutdown_wrong_outnum=?," // 37
2559-
" lease_expiry=?," // 38
2560-
" lease_commit_sig=?," // 39
2561-
" lease_chan_max_msat=?," // 40
2562-
" lease_chan_max_ppt=?," // 41
2563-
" htlc_minimum_msat=?," // 42
2564-
" htlc_maximum_msat=?," // 43
2565-
" alias_local=?," // 44
2566-
" alias_remote=?," // 45
2567-
" ignore_fee_limits=?," // 46
2568-
" remote_feerate_base=?," // 47
2569-
" remote_feerate_ppm=?," // 48
2570-
" remote_cltv_expiry_delta=?," // 49
2571-
" remote_htlc_minimum_msat=?," // 50
2572-
" remote_htlc_maximum_msat=?," // 51
2573-
" last_stable_connection=?," // 52
2574-
" require_confirm_inputs_remote=?," // 53
2575-
" close_attempt_height=?" // 54
2576-
" WHERE id=?")); // 55
2540+
" shutdown_keyidx_local=?,"
2541+
" channel_config_local=?,"
2542+
" last_tx=?, last_sig=?,"
2543+
" last_was_revoke=?,"
2544+
" min_possible_feerate=?,"
2545+
" max_possible_feerate=?,"
2546+
" msatoshi_to_us_min=?,"
2547+
" msatoshi_to_us_max=?,"
2548+
" feerate_base=?,"
2549+
" feerate_ppm=?,"
2550+
" remote_upfront_shutdown_script=?,"
2551+
" local_static_remotekey_start=?,"
2552+
" remote_static_remotekey_start=?,"
2553+
" channel_type=?,"
2554+
" shutdown_scriptpubkey_local=?,"
2555+
" closer=?,"
2556+
" state_change_reason=?,"
2557+
" shutdown_wrong_txid=?,"
2558+
" shutdown_wrong_outnum=?,"
2559+
" lease_expiry=?,"
2560+
" lease_commit_sig=?,"
2561+
" lease_chan_max_msat=?,"
2562+
" lease_chan_max_ppt=?,"
2563+
" htlc_minimum_msat=?,"
2564+
" htlc_maximum_msat=?,"
2565+
" alias_local=?,"
2566+
" alias_remote=?,"
2567+
" ignore_fee_limits=?,"
2568+
" remote_feerate_base=?,"
2569+
" remote_feerate_ppm=?,"
2570+
" remote_cltv_expiry_delta=?,"
2571+
" remote_htlc_minimum_msat=?,"
2572+
" remote_htlc_maximum_msat=?,"
2573+
" last_stable_connection=?,"
2574+
" require_confirm_inputs_remote=?,"
2575+
" close_attempt_height=?"
2576+
" WHERE id=?"));
25772577
db_bind_u64(stmt, chan->their_shachain.id);
25782578
if (chan->scid)
25792579
db_bind_short_channel_id(stmt, *chan->scid);

0 commit comments

Comments
 (0)