diff --git a/channeld/channeld.c b/channeld/channeld.c index 70feccca6..9147b8cc9 100644 --- a/channeld/channeld.c +++ b/channeld/channeld.c @@ -391,7 +391,8 @@ static void set_channel_type(struct channel *channel, channel->type = channel_type_dup(channel, type); status_unusual("Upgraded channel to [%s]", fmt_featurebits(tmpctx, type->features)); - wire_sync_write(MASTER_FD, take(towire_channeld_upgraded(NULL, true))); + wire_sync_write(MASTER_FD, + take(towire_channeld_upgraded(NULL, channel->type))); } #else /* !EXPERIMENTAL_FEATURES */ static bool handle_master_request_later(struct peer *peer, const u8 *msg) @@ -3644,7 +3645,6 @@ static void init_channel(struct peer *peer) struct secret last_remote_per_commit_secret; secp256k1_ecdsa_signature *remote_ann_node_sig; secp256k1_ecdsa_signature *remote_ann_bitcoin_sig; - bool option_static_remotekey, option_anchor_outputs; struct penalty_base *pbases; u8 *reestablish_only; struct channel_type *channel_type; @@ -3708,8 +3708,7 @@ static void init_channel(struct peer *peer) &peer->remote_upfront_shutdown_script, &remote_ann_node_sig, &remote_ann_bitcoin_sig, - &option_static_remotekey, - &option_anchor_outputs, + &channel_type, &dev_fast_gossip, &dev_fail_process_onionpacket, &pbases, @@ -3718,7 +3717,8 @@ static void init_channel(struct peer *peer) } status_debug("option_static_remotekey = %u, option_anchor_outputs = %u", - option_static_remotekey, option_anchor_outputs); + channel_type_has(channel_type, OPT_STATIC_REMOTEKEY), + channel_type_has(channel_type, OPT_ANCHOR_OUTPUTS)); /* Keeping an array of pointers is better since it allows us to avoid * extra allocations later. */ @@ -3749,8 +3749,6 @@ static void init_channel(struct peer *peer) type_to_string(tmpctx, struct height_states, blockheight_states), peer->our_blockheight); - status_debug("option_static_remotekey = %u", option_static_remotekey); - if (remote_ann_node_sig && remote_ann_bitcoin_sig) { peer->announcement_node_sigs[REMOTE] = *remote_ann_node_sig; peer->announcement_bitcoin_sigs[REMOTE] = *remote_ann_bitcoin_sig; @@ -3773,14 +3771,6 @@ static void init_channel(struct peer *peer) get_per_commitment_point(peer->next_index[LOCAL], &peer->next_local_per_commit, NULL); - /* FIXME: hand type directly from lightningd! */ - if (option_anchor_outputs) - channel_type = channel_type_anchor_outputs(NULL); - else if (option_static_remotekey) - channel_type = channel_type_static_remotekey(NULL); - else - channel_type = channel_type_none(NULL); - peer->channel = new_full_channel(peer, &peer->channel_id, &funding_txid, funding_txout, diff --git a/channeld/channeld_wire.csv b/channeld/channeld_wire.csv index def355dea..daf0eaa3e 100644 --- a/channeld/channeld_wire.csv +++ b/channeld/channeld_wire.csv @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -71,8 +72,7 @@ msgdata,channeld_init,upfront_shutdown_script_len,u16, msgdata,channeld_init,upfront_shutdown_script,u8,upfront_shutdown_script_len msgdata,channeld_init,remote_ann_node_sig,?secp256k1_ecdsa_signature, msgdata,channeld_init,remote_ann_bitcoin_sig,?secp256k1_ecdsa_signature, -msgdata,channeld_init,option_static_remotekey,bool, -msgdata,channeld_init,option_anchor_outputs,bool, +msgdata,channeld_init,desired_type,channel_type, msgdata,channeld_init,dev_fast_gossip,bool, msgdata,channeld_init,dev_fail_process_onionpacket,bool, msgdata,channeld_init,num_penalty_bases,u32, @@ -233,7 +233,7 @@ msgtype,channeld_dev_quiesce_reply,1109 # Tell master we're upgrading the commitment tx. msgtype,channeld_upgraded,1011 -msgdata,channeld_upgraded,option_static_remotekey,bool, +msgdata,channeld_upgraded,new_type,channel_type, # Tell peer about our latest and greatest blockheight. msgtype,channeld_blockheight,1012 diff --git a/channeld/channeld_wiregen.c b/channeld/channeld_wiregen.c index 5ceb3e750..a6133921e 100644 --- a/channeld/channeld_wiregen.c +++ b/channeld/channeld_wiregen.c @@ -100,7 +100,7 @@ bool channeld_wire_is_defined(u16 type) /* WIRE: CHANNELD_INIT */ /* Begin! (passes gossipd-client fd) */ -u8 *towire_channeld_init(const tal_t *ctx, const struct chainparams *chainparams, const struct feature_set *our_features, const struct channel_id *channel_id, const struct bitcoin_txid *funding_txid, u16 funding_txout, struct amount_sat funding_satoshi, u32 minimum_depth, u32 our_blockheight, const struct height_states *blockheight_states, u32 lease_expiry, const struct channel_config *our_config, const struct channel_config *their_config, const struct fee_states *fee_states, u32 feerate_min, u32 feerate_max, u32 feerate_penalty, const struct bitcoin_signature *first_commit_sig, const struct per_peer_state *per_peer_state, const struct pubkey *remote_fundingkey, const struct basepoints *remote_basepoints, const struct pubkey *remote_per_commit, const struct pubkey *old_remote_per_commit, enum side opener, u32 fee_base, u32 fee_proportional, struct amount_msat local_msatoshi, const struct basepoints *our_basepoints, const struct pubkey *our_funding_pubkey, const struct node_id *local_node_id, const struct node_id *remote_node_id, u32 commit_msec, u16 cltv_delta, bool last_was_revoke, const struct changed_htlc *last_sent_commit, u64 next_index_local, u64 next_index_remote, u64 revocations_received, u64 next_htlc_id, const struct existing_htlc **htlcs, bool local_funding_locked, bool remote_funding_locked, const struct short_channel_id *funding_short_id, bool reestablish, bool send_shutdown, bool remote_shutdown_received, const u8 *final_scriptpubkey, u8 flags, const u8 *init_peer_pkt, bool reached_announce_depth, const struct secret *last_remote_secret, const u8 *their_features, const u8 *upfront_shutdown_script, const secp256k1_ecdsa_signature *remote_ann_node_sig, const secp256k1_ecdsa_signature *remote_ann_bitcoin_sig, bool option_static_remotekey, bool option_anchor_outputs, bool dev_fast_gossip, bool dev_fail_process_onionpacket, const struct penalty_base *pbases, const u8 *reestablish_only) +u8 *towire_channeld_init(const tal_t *ctx, const struct chainparams *chainparams, const struct feature_set *our_features, const struct channel_id *channel_id, const struct bitcoin_txid *funding_txid, u16 funding_txout, struct amount_sat funding_satoshi, u32 minimum_depth, u32 our_blockheight, const struct height_states *blockheight_states, u32 lease_expiry, const struct channel_config *our_config, const struct channel_config *their_config, const struct fee_states *fee_states, u32 feerate_min, u32 feerate_max, u32 feerate_penalty, const struct bitcoin_signature *first_commit_sig, const struct per_peer_state *per_peer_state, const struct pubkey *remote_fundingkey, const struct basepoints *remote_basepoints, const struct pubkey *remote_per_commit, const struct pubkey *old_remote_per_commit, enum side opener, u32 fee_base, u32 fee_proportional, struct amount_msat local_msatoshi, const struct basepoints *our_basepoints, const struct pubkey *our_funding_pubkey, const struct node_id *local_node_id, const struct node_id *remote_node_id, u32 commit_msec, u16 cltv_delta, bool last_was_revoke, const struct changed_htlc *last_sent_commit, u64 next_index_local, u64 next_index_remote, u64 revocations_received, u64 next_htlc_id, const struct existing_htlc **htlcs, bool local_funding_locked, bool remote_funding_locked, const struct short_channel_id *funding_short_id, bool reestablish, bool send_shutdown, bool remote_shutdown_received, const u8 *final_scriptpubkey, u8 flags, const u8 *init_peer_pkt, bool reached_announce_depth, const struct secret *last_remote_secret, const u8 *their_features, const u8 *upfront_shutdown_script, const secp256k1_ecdsa_signature *remote_ann_node_sig, const secp256k1_ecdsa_signature *remote_ann_bitcoin_sig, const struct channel_type *desired_type, bool dev_fast_gossip, bool dev_fail_process_onionpacket, const struct penalty_base *pbases, const u8 *reestablish_only) { u16 num_last_sent_commit = tal_count(last_sent_commit); u16 num_existing_htlcs = tal_count(htlcs); @@ -185,8 +185,7 @@ u8 *towire_channeld_init(const tal_t *ctx, const struct chainparams *chainparams towire_bool(&p, true); towire_secp256k1_ecdsa_signature(&p, remote_ann_bitcoin_sig); } - towire_bool(&p, option_static_remotekey); - towire_bool(&p, option_anchor_outputs); + towire_channel_type(&p, desired_type); towire_bool(&p, dev_fast_gossip); towire_bool(&p, dev_fail_process_onionpacket); towire_u32(&p, num_penalty_bases); @@ -197,7 +196,7 @@ u8 *towire_channeld_init(const tal_t *ctx, const struct chainparams *chainparams return memcheck(p, tal_count(p)); } -bool fromwire_channeld_init(const tal_t *ctx, const void *p, const struct chainparams **chainparams, struct feature_set **our_features, struct channel_id *channel_id, struct bitcoin_txid *funding_txid, u16 *funding_txout, struct amount_sat *funding_satoshi, u32 *minimum_depth, u32 *our_blockheight, struct height_states **blockheight_states, u32 *lease_expiry, struct channel_config *our_config, struct channel_config *their_config, struct fee_states **fee_states, u32 *feerate_min, u32 *feerate_max, u32 *feerate_penalty, struct bitcoin_signature *first_commit_sig, struct per_peer_state **per_peer_state, struct pubkey *remote_fundingkey, struct basepoints *remote_basepoints, struct pubkey *remote_per_commit, struct pubkey *old_remote_per_commit, enum side *opener, u32 *fee_base, u32 *fee_proportional, struct amount_msat *local_msatoshi, struct basepoints *our_basepoints, struct pubkey *our_funding_pubkey, struct node_id *local_node_id, struct node_id *remote_node_id, u32 *commit_msec, u16 *cltv_delta, bool *last_was_revoke, struct changed_htlc **last_sent_commit, u64 *next_index_local, u64 *next_index_remote, u64 *revocations_received, u64 *next_htlc_id, struct existing_htlc ***htlcs, bool *local_funding_locked, bool *remote_funding_locked, struct short_channel_id *funding_short_id, bool *reestablish, bool *send_shutdown, bool *remote_shutdown_received, u8 **final_scriptpubkey, u8 *flags, u8 **init_peer_pkt, bool *reached_announce_depth, struct secret *last_remote_secret, u8 **their_features, u8 **upfront_shutdown_script, secp256k1_ecdsa_signature **remote_ann_node_sig, secp256k1_ecdsa_signature **remote_ann_bitcoin_sig, bool *option_static_remotekey, bool *option_anchor_outputs, bool *dev_fast_gossip, bool *dev_fail_process_onionpacket, struct penalty_base **pbases, u8 **reestablish_only) +bool fromwire_channeld_init(const tal_t *ctx, const void *p, const struct chainparams **chainparams, struct feature_set **our_features, struct channel_id *channel_id, struct bitcoin_txid *funding_txid, u16 *funding_txout, struct amount_sat *funding_satoshi, u32 *minimum_depth, u32 *our_blockheight, struct height_states **blockheight_states, u32 *lease_expiry, struct channel_config *our_config, struct channel_config *their_config, struct fee_states **fee_states, u32 *feerate_min, u32 *feerate_max, u32 *feerate_penalty, struct bitcoin_signature *first_commit_sig, struct per_peer_state **per_peer_state, struct pubkey *remote_fundingkey, struct basepoints *remote_basepoints, struct pubkey *remote_per_commit, struct pubkey *old_remote_per_commit, enum side *opener, u32 *fee_base, u32 *fee_proportional, struct amount_msat *local_msatoshi, struct basepoints *our_basepoints, struct pubkey *our_funding_pubkey, struct node_id *local_node_id, struct node_id *remote_node_id, u32 *commit_msec, u16 *cltv_delta, bool *last_was_revoke, struct changed_htlc **last_sent_commit, u64 *next_index_local, u64 *next_index_remote, u64 *revocations_received, u64 *next_htlc_id, struct existing_htlc ***htlcs, bool *local_funding_locked, bool *remote_funding_locked, struct short_channel_id *funding_short_id, bool *reestablish, bool *send_shutdown, bool *remote_shutdown_received, u8 **final_scriptpubkey, u8 *flags, u8 **init_peer_pkt, bool *reached_announce_depth, struct secret *last_remote_secret, u8 **their_features, u8 **upfront_shutdown_script, secp256k1_ecdsa_signature **remote_ann_node_sig, secp256k1_ecdsa_signature **remote_ann_bitcoin_sig, struct channel_type **desired_type, bool *dev_fast_gossip, bool *dev_fail_process_onionpacket, struct penalty_base **pbases, u8 **reestablish_only) { u16 num_last_sent_commit; u16 num_existing_htlcs; @@ -297,8 +296,7 @@ bool fromwire_channeld_init(const tal_t *ctx, const void *p, const struct chainp *remote_ann_bitcoin_sig = tal(ctx, secp256k1_ecdsa_signature); fromwire_secp256k1_ecdsa_signature(&cursor, &plen, *remote_ann_bitcoin_sig); } - *option_static_remotekey = fromwire_bool(&cursor, &plen); - *option_anchor_outputs = fromwire_bool(&cursor, &plen); + *desired_type = fromwire_channel_type(ctx, &cursor, &plen); *dev_fast_gossip = fromwire_bool(&cursor, &plen); *dev_fail_process_onionpacket = fromwire_bool(&cursor, &plen); num_penalty_bases = fromwire_u32(&cursor, &plen); @@ -1140,23 +1138,23 @@ bool fromwire_channeld_dev_quiesce_reply(const void *p) /* WIRE: CHANNELD_UPGRADED */ /* Tell master we're upgrading the commitment tx. */ -u8 *towire_channeld_upgraded(const tal_t *ctx, bool option_static_remotekey) +u8 *towire_channeld_upgraded(const tal_t *ctx, const struct channel_type *new_type) { u8 *p = tal_arr(ctx, u8, 0); towire_u16(&p, WIRE_CHANNELD_UPGRADED); - towire_bool(&p, option_static_remotekey); + towire_channel_type(&p, new_type); return memcheck(p, tal_count(p)); } -bool fromwire_channeld_upgraded(const void *p, bool *option_static_remotekey) +bool fromwire_channeld_upgraded(const tal_t *ctx, const void *p, struct channel_type **new_type) { const u8 *cursor = p; size_t plen = tal_count(p); if (fromwire_u16(&cursor, &plen) != WIRE_CHANNELD_UPGRADED) return false; - *option_static_remotekey = fromwire_bool(&cursor, &plen); + *new_type = fromwire_channel_type(ctx, &cursor, &plen); return cursor != NULL; } @@ -1181,4 +1179,4 @@ bool fromwire_channeld_blockheight(const void *p, u32 *blockheight) *blockheight = fromwire_u32(&cursor, &plen); return cursor != NULL; } -// SHA256STAMP:61caa30da7bcc0a39b2b13a94d5c24a386a6b7a6f4c0800cb37e46e423824f61 +// SHA256STAMP:d00ca466d1339c66bbed6afc95227ca89177dab02344de8e333cc11f85e82cd9 diff --git a/channeld/channeld_wiregen.h b/channeld/channeld_wiregen.h index 6af2a165c..0dd587a0d 100644 --- a/channeld/channeld_wiregen.h +++ b/channeld/channeld_wiregen.h @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -94,8 +95,8 @@ bool channeld_wire_is_defined(u16 type); /* WIRE: CHANNELD_INIT */ /* Begin! (passes gossipd-client fd) */ -u8 *towire_channeld_init(const tal_t *ctx, const struct chainparams *chainparams, const struct feature_set *our_features, const struct channel_id *channel_id, const struct bitcoin_txid *funding_txid, u16 funding_txout, struct amount_sat funding_satoshi, u32 minimum_depth, u32 our_blockheight, const struct height_states *blockheight_states, u32 lease_expiry, const struct channel_config *our_config, const struct channel_config *their_config, const struct fee_states *fee_states, u32 feerate_min, u32 feerate_max, u32 feerate_penalty, const struct bitcoin_signature *first_commit_sig, const struct per_peer_state *per_peer_state, const struct pubkey *remote_fundingkey, const struct basepoints *remote_basepoints, const struct pubkey *remote_per_commit, const struct pubkey *old_remote_per_commit, enum side opener, u32 fee_base, u32 fee_proportional, struct amount_msat local_msatoshi, const struct basepoints *our_basepoints, const struct pubkey *our_funding_pubkey, const struct node_id *local_node_id, const struct node_id *remote_node_id, u32 commit_msec, u16 cltv_delta, bool last_was_revoke, const struct changed_htlc *last_sent_commit, u64 next_index_local, u64 next_index_remote, u64 revocations_received, u64 next_htlc_id, const struct existing_htlc **htlcs, bool local_funding_locked, bool remote_funding_locked, const struct short_channel_id *funding_short_id, bool reestablish, bool send_shutdown, bool remote_shutdown_received, const u8 *final_scriptpubkey, u8 flags, const u8 *init_peer_pkt, bool reached_announce_depth, const struct secret *last_remote_secret, const u8 *their_features, const u8 *upfront_shutdown_script, const secp256k1_ecdsa_signature *remote_ann_node_sig, const secp256k1_ecdsa_signature *remote_ann_bitcoin_sig, bool option_static_remotekey, bool option_anchor_outputs, bool dev_fast_gossip, bool dev_fail_process_onionpacket, const struct penalty_base *pbases, const u8 *reestablish_only); -bool fromwire_channeld_init(const tal_t *ctx, const void *p, const struct chainparams **chainparams, struct feature_set **our_features, struct channel_id *channel_id, struct bitcoin_txid *funding_txid, u16 *funding_txout, struct amount_sat *funding_satoshi, u32 *minimum_depth, u32 *our_blockheight, struct height_states **blockheight_states, u32 *lease_expiry, struct channel_config *our_config, struct channel_config *their_config, struct fee_states **fee_states, u32 *feerate_min, u32 *feerate_max, u32 *feerate_penalty, struct bitcoin_signature *first_commit_sig, struct per_peer_state **per_peer_state, struct pubkey *remote_fundingkey, struct basepoints *remote_basepoints, struct pubkey *remote_per_commit, struct pubkey *old_remote_per_commit, enum side *opener, u32 *fee_base, u32 *fee_proportional, struct amount_msat *local_msatoshi, struct basepoints *our_basepoints, struct pubkey *our_funding_pubkey, struct node_id *local_node_id, struct node_id *remote_node_id, u32 *commit_msec, u16 *cltv_delta, bool *last_was_revoke, struct changed_htlc **last_sent_commit, u64 *next_index_local, u64 *next_index_remote, u64 *revocations_received, u64 *next_htlc_id, struct existing_htlc ***htlcs, bool *local_funding_locked, bool *remote_funding_locked, struct short_channel_id *funding_short_id, bool *reestablish, bool *send_shutdown, bool *remote_shutdown_received, u8 **final_scriptpubkey, u8 *flags, u8 **init_peer_pkt, bool *reached_announce_depth, struct secret *last_remote_secret, u8 **their_features, u8 **upfront_shutdown_script, secp256k1_ecdsa_signature **remote_ann_node_sig, secp256k1_ecdsa_signature **remote_ann_bitcoin_sig, bool *option_static_remotekey, bool *option_anchor_outputs, bool *dev_fast_gossip, bool *dev_fail_process_onionpacket, struct penalty_base **pbases, u8 **reestablish_only); +u8 *towire_channeld_init(const tal_t *ctx, const struct chainparams *chainparams, const struct feature_set *our_features, const struct channel_id *channel_id, const struct bitcoin_txid *funding_txid, u16 funding_txout, struct amount_sat funding_satoshi, u32 minimum_depth, u32 our_blockheight, const struct height_states *blockheight_states, u32 lease_expiry, const struct channel_config *our_config, const struct channel_config *their_config, const struct fee_states *fee_states, u32 feerate_min, u32 feerate_max, u32 feerate_penalty, const struct bitcoin_signature *first_commit_sig, const struct per_peer_state *per_peer_state, const struct pubkey *remote_fundingkey, const struct basepoints *remote_basepoints, const struct pubkey *remote_per_commit, const struct pubkey *old_remote_per_commit, enum side opener, u32 fee_base, u32 fee_proportional, struct amount_msat local_msatoshi, const struct basepoints *our_basepoints, const struct pubkey *our_funding_pubkey, const struct node_id *local_node_id, const struct node_id *remote_node_id, u32 commit_msec, u16 cltv_delta, bool last_was_revoke, const struct changed_htlc *last_sent_commit, u64 next_index_local, u64 next_index_remote, u64 revocations_received, u64 next_htlc_id, const struct existing_htlc **htlcs, bool local_funding_locked, bool remote_funding_locked, const struct short_channel_id *funding_short_id, bool reestablish, bool send_shutdown, bool remote_shutdown_received, const u8 *final_scriptpubkey, u8 flags, const u8 *init_peer_pkt, bool reached_announce_depth, const struct secret *last_remote_secret, const u8 *their_features, const u8 *upfront_shutdown_script, const secp256k1_ecdsa_signature *remote_ann_node_sig, const secp256k1_ecdsa_signature *remote_ann_bitcoin_sig, const struct channel_type *desired_type, bool dev_fast_gossip, bool dev_fail_process_onionpacket, const struct penalty_base *pbases, const u8 *reestablish_only); +bool fromwire_channeld_init(const tal_t *ctx, const void *p, const struct chainparams **chainparams, struct feature_set **our_features, struct channel_id *channel_id, struct bitcoin_txid *funding_txid, u16 *funding_txout, struct amount_sat *funding_satoshi, u32 *minimum_depth, u32 *our_blockheight, struct height_states **blockheight_states, u32 *lease_expiry, struct channel_config *our_config, struct channel_config *their_config, struct fee_states **fee_states, u32 *feerate_min, u32 *feerate_max, u32 *feerate_penalty, struct bitcoin_signature *first_commit_sig, struct per_peer_state **per_peer_state, struct pubkey *remote_fundingkey, struct basepoints *remote_basepoints, struct pubkey *remote_per_commit, struct pubkey *old_remote_per_commit, enum side *opener, u32 *fee_base, u32 *fee_proportional, struct amount_msat *local_msatoshi, struct basepoints *our_basepoints, struct pubkey *our_funding_pubkey, struct node_id *local_node_id, struct node_id *remote_node_id, u32 *commit_msec, u16 *cltv_delta, bool *last_was_revoke, struct changed_htlc **last_sent_commit, u64 *next_index_local, u64 *next_index_remote, u64 *revocations_received, u64 *next_htlc_id, struct existing_htlc ***htlcs, bool *local_funding_locked, bool *remote_funding_locked, struct short_channel_id *funding_short_id, bool *reestablish, bool *send_shutdown, bool *remote_shutdown_received, u8 **final_scriptpubkey, u8 *flags, u8 **init_peer_pkt, bool *reached_announce_depth, struct secret *last_remote_secret, u8 **their_features, u8 **upfront_shutdown_script, secp256k1_ecdsa_signature **remote_ann_node_sig, secp256k1_ecdsa_signature **remote_ann_bitcoin_sig, struct channel_type **desired_type, bool *dev_fast_gossip, bool *dev_fail_process_onionpacket, struct penalty_base **pbases, u8 **reestablish_only); /* WIRE: CHANNELD_FUNDING_DEPTH */ /* master->channeld funding hit new depth(funding locked if >= lock depth) */ @@ -230,8 +231,8 @@ bool fromwire_channeld_dev_quiesce_reply(const void *p); /* WIRE: CHANNELD_UPGRADED */ /* Tell master we're upgrading the commitment tx. */ -u8 *towire_channeld_upgraded(const tal_t *ctx, bool option_static_remotekey); -bool fromwire_channeld_upgraded(const void *p, bool *option_static_remotekey); +u8 *towire_channeld_upgraded(const tal_t *ctx, const struct channel_type *new_type); +bool fromwire_channeld_upgraded(const tal_t *ctx, const void *p, struct channel_type **new_type); /* WIRE: CHANNELD_BLOCKHEIGHT */ /* Tell peer about our latest and greatest blockheight. */ @@ -240,4 +241,4 @@ bool fromwire_channeld_blockheight(const void *p, u32 *blockheight); #endif /* LIGHTNING_CHANNELD_CHANNELD_WIREGEN_H */ -// SHA256STAMP:61caa30da7bcc0a39b2b13a94d5c24a386a6b7a6f4c0800cb37e46e423824f61 +// SHA256STAMP:d00ca466d1339c66bbed6afc95227ca89177dab02344de8e333cc11f85e82cd9 diff --git a/closingd/closingd_wiregen.c b/closingd/closingd_wiregen.c index 0d70f57fb..9412bba5f 100644 --- a/closingd/closingd_wiregen.c +++ b/closingd/closingd_wiregen.c @@ -209,4 +209,4 @@ bool fromwire_closingd_complete(const void *p) return false; return cursor != NULL; } -// SHA256STAMP:bda282f9c8cf3c0fc1274165b9adeb691f0447fd9c27cb4bbe0717e809df4a95 +// SHA256STAMP:0d0d56c4ec5230461ead5cfac728e57e75db7bff1b53b1b0aaef20b82ce76362 diff --git a/closingd/closingd_wiregen.h b/closingd/closingd_wiregen.h index 89673a73c..e4162fa3f 100644 --- a/closingd/closingd_wiregen.h +++ b/closingd/closingd_wiregen.h @@ -56,4 +56,4 @@ bool fromwire_closingd_complete(const void *p); #endif /* LIGHTNING_CLOSINGD_CLOSINGD_WIREGEN_H */ -// SHA256STAMP:bda282f9c8cf3c0fc1274165b9adeb691f0447fd9c27cb4bbe0717e809df4a95 +// SHA256STAMP:0d0d56c4ec5230461ead5cfac728e57e75db7bff1b53b1b0aaef20b82ce76362 diff --git a/common/peer_status_wiregen.c b/common/peer_status_wiregen.c index b8684f241..b49df4f58 100644 --- a/common/peer_status_wiregen.c +++ b/common/peer_status_wiregen.c @@ -80,4 +80,4 @@ bool fromwire_status_peer_error(const tal_t *ctx, const void *p, struct channel_ fromwire_u8_array(&cursor, &plen, *error_for_them, len); return cursor != NULL; } -// SHA256STAMP:b3244d3c5f959de2b906e7afc98c3278282ab06eab89c7572c424b36b994c484 +// SHA256STAMP:a247441c5a012c0dcaab043780943604354ff5c4f360f83b87fcea94816eab8e diff --git a/common/peer_status_wiregen.h b/common/peer_status_wiregen.h index 350d65876..1c7bce968 100644 --- a/common/peer_status_wiregen.h +++ b/common/peer_status_wiregen.h @@ -34,4 +34,4 @@ bool fromwire_status_peer_error(const tal_t *ctx, const void *p, struct channel_ #endif /* LIGHTNING_COMMON_PEER_STATUS_WIREGEN_H */ -// SHA256STAMP:b3244d3c5f959de2b906e7afc98c3278282ab06eab89c7572c424b36b994c484 +// SHA256STAMP:a247441c5a012c0dcaab043780943604354ff5c4f360f83b87fcea94816eab8e diff --git a/common/status_wiregen.c b/common/status_wiregen.c index 53be92d4d..2537a1079 100644 --- a/common/status_wiregen.c +++ b/common/status_wiregen.c @@ -214,4 +214,4 @@ bool fromwire_status_version(const tal_t *ctx, const void *p, wirestring **versi *version = fromwire_wirestring(ctx, &cursor, &plen); return cursor != NULL; } -// SHA256STAMP:9ccc7c9a9c09390733ffde17bcee096fef4b4edbf469a5037574fe8eefe6f946 +// SHA256STAMP:9a7b4598fad40c5df016c17464c3c8f7b067a17eb993cc65fea42486e3ffb3f7 diff --git a/common/status_wiregen.h b/common/status_wiregen.h index 7eb0e8276..fea26f6af 100644 --- a/common/status_wiregen.h +++ b/common/status_wiregen.h @@ -58,4 +58,4 @@ bool fromwire_status_version(const tal_t *ctx, const void *p, wirestring **versi #endif /* LIGHTNING_COMMON_STATUS_WIREGEN_H */ -// SHA256STAMP:9ccc7c9a9c09390733ffde17bcee096fef4b4edbf469a5037574fe8eefe6f946 +// SHA256STAMP:9a7b4598fad40c5df016c17464c3c8f7b067a17eb993cc65fea42486e3ffb3f7 diff --git a/connectd/connectd_gossipd_wiregen.c b/connectd/connectd_gossipd_wiregen.c index 0b2ab644f..f73814253 100644 --- a/connectd/connectd_gossipd_wiregen.c +++ b/connectd/connectd_gossipd_wiregen.c @@ -161,4 +161,4 @@ bool fromwire_gossipd_get_addrs_reply(const tal_t *ctx, const void *p, struct wi fromwire_wireaddr(&cursor, &plen, *addrs + i); return cursor != NULL; } -// SHA256STAMP:6dce0976ccde7d8461a17a5b87e00a6f6cd0256d26d29843ff15d7be82161316 +// SHA256STAMP:69dd930932c97655f56c92bd396446582b149e27ca26e0dcd3a29005ea078158 diff --git a/connectd/connectd_gossipd_wiregen.h b/connectd/connectd_gossipd_wiregen.h index 53598f5eb..719fb19da 100644 --- a/connectd/connectd_gossipd_wiregen.h +++ b/connectd/connectd_gossipd_wiregen.h @@ -54,4 +54,4 @@ bool fromwire_gossipd_get_addrs_reply(const tal_t *ctx, const void *p, struct wi #endif /* LIGHTNING_CONNECTD_CONNECTD_GOSSIPD_WIREGEN_H */ -// SHA256STAMP:6dce0976ccde7d8461a17a5b87e00a6f6cd0256d26d29843ff15d7be82161316 +// SHA256STAMP:69dd930932c97655f56c92bd396446582b149e27ca26e0dcd3a29005ea078158 diff --git a/connectd/connectd_wiregen.c b/connectd/connectd_wiregen.c index 918216919..4f682f12b 100644 --- a/connectd/connectd_wiregen.c +++ b/connectd/connectd_wiregen.c @@ -443,4 +443,4 @@ bool fromwire_connectd_dev_memleak_reply(const void *p, bool *leak) *leak = fromwire_bool(&cursor, &plen); return cursor != NULL; } -// SHA256STAMP:89a554e6550ee7c67c1526475e03fa2862335159ec5ff3e7c511da5c040e71a7 +// SHA256STAMP:3b0f7e87bf73dc1fd4f7181f61fc648f2fc0c4aad946edc9d9c80d90c99e9bcf diff --git a/connectd/connectd_wiregen.h b/connectd/connectd_wiregen.h index 373ab44e2..b0a7c4667 100644 --- a/connectd/connectd_wiregen.h +++ b/connectd/connectd_wiregen.h @@ -110,4 +110,4 @@ bool fromwire_connectd_dev_memleak_reply(const void *p, bool *leak); #endif /* LIGHTNING_CONNECTD_CONNECTD_WIREGEN_H */ -// SHA256STAMP:89a554e6550ee7c67c1526475e03fa2862335159ec5ff3e7c511da5c040e71a7 +// SHA256STAMP:3b0f7e87bf73dc1fd4f7181f61fc648f2fc0c4aad946edc9d9c80d90c99e9bcf diff --git a/gossipd/gossip_store_wiregen.c b/gossipd/gossip_store_wiregen.c index f583f5766..d50903cf4 100644 --- a/gossipd/gossip_store_wiregen.c +++ b/gossipd/gossip_store_wiregen.c @@ -210,4 +210,4 @@ bool fromwire_gossipd_local_add_channel_obs(const tal_t *ctx, const void *p, str fromwire_u8_array(&cursor, &plen, *features, flen); return cursor != NULL; } -// SHA256STAMP:795023c4916bb16e65d205888cbafe856143146585086230087a7c96350cafb8 +// SHA256STAMP:f145d927f4dfe0434bf705f22e3cfae212f96ef95c1cd4dc31fe53c000ef5adb diff --git a/gossipd/gossip_store_wiregen.h b/gossipd/gossip_store_wiregen.h index 9b6679c5e..546d3953a 100644 --- a/gossipd/gossip_store_wiregen.h +++ b/gossipd/gossip_store_wiregen.h @@ -63,4 +63,4 @@ bool fromwire_gossipd_local_add_channel_obs(const tal_t *ctx, const void *p, str #endif /* LIGHTNING_GOSSIPD_GOSSIP_STORE_WIREGEN_H */ -// SHA256STAMP:795023c4916bb16e65d205888cbafe856143146585086230087a7c96350cafb8 +// SHA256STAMP:f145d927f4dfe0434bf705f22e3cfae212f96ef95c1cd4dc31fe53c000ef5adb diff --git a/gossipd/gossipd_peerd_wiregen.c b/gossipd/gossipd_peerd_wiregen.c index 3b50025be..2bf02e54a 100644 --- a/gossipd/gossipd_peerd_wiregen.c +++ b/gossipd/gossipd_peerd_wiregen.c @@ -161,4 +161,4 @@ bool fromwire_gossipd_local_channel_announcement(const tal_t *ctx, const void *p fromwire_u8_array(&cursor, &plen, *cannount, len); return cursor != NULL; } -// SHA256STAMP:f3c8b8c99b8a6d1e0337375ea2e252024b99bc8e88d86a91387f0886b7cfffff +// SHA256STAMP:b3c6474e393f3aa6427a63a1b1ad873badc6d0592ae8247add28a099815cdbdd diff --git a/gossipd/gossipd_peerd_wiregen.h b/gossipd/gossipd_peerd_wiregen.h index 755c2fbba..85d01ef81 100644 --- a/gossipd/gossipd_peerd_wiregen.h +++ b/gossipd/gossipd_peerd_wiregen.h @@ -57,4 +57,4 @@ bool fromwire_gossipd_local_channel_announcement(const tal_t *ctx, const void *p #endif /* LIGHTNING_GOSSIPD_GOSSIPD_PEERD_WIREGEN_H */ -// SHA256STAMP:f3c8b8c99b8a6d1e0337375ea2e252024b99bc8e88d86a91387f0886b7cfffff +// SHA256STAMP:b3c6474e393f3aa6427a63a1b1ad873badc6d0592ae8247add28a099815cdbdd diff --git a/gossipd/gossipd_wiregen.c b/gossipd/gossipd_wiregen.c index a4119704c..7bc411121 100644 --- a/gossipd/gossipd_wiregen.c +++ b/gossipd/gossipd_wiregen.c @@ -777,4 +777,4 @@ bool fromwire_gossipd_new_lease_rates(const void *p, struct lease_rates *rates) fromwire_lease_rates(&cursor, &plen, rates); return cursor != NULL; } -// SHA256STAMP:14767c196ce9ab6b891ea20a5f620a5fcb94f67ffc23d757a04222cc8012e1af +// SHA256STAMP:1e4178d4f98e129e7779fd49321404eb7ec8bad4ca58655ed7e3039be9b24fe0 diff --git a/gossipd/gossipd_wiregen.h b/gossipd/gossipd_wiregen.h index 01e1c00de..ab24b7835 100644 --- a/gossipd/gossipd_wiregen.h +++ b/gossipd/gossipd_wiregen.h @@ -188,4 +188,4 @@ bool fromwire_gossipd_new_lease_rates(const void *p, struct lease_rates *rates); #endif /* LIGHTNING_GOSSIPD_GOSSIPD_WIREGEN_H */ -// SHA256STAMP:14767c196ce9ab6b891ea20a5f620a5fcb94f67ffc23d757a04222cc8012e1af +// SHA256STAMP:1e4178d4f98e129e7779fd49321404eb7ec8bad4ca58655ed7e3039be9b24fe0 diff --git a/hsmd/hsmd_wiregen.c b/hsmd/hsmd_wiregen.c index aa43d9b13..5ddc95a56 100644 --- a/hsmd/hsmd_wiregen.c +++ b/hsmd/hsmd_wiregen.c @@ -1331,4 +1331,4 @@ bool fromwire_hsmd_sign_option_will_fund_offer_reply(const void *p, secp256k1_ec fromwire_secp256k1_ecdsa_signature(&cursor, &plen, rsig); return cursor != NULL; } -// SHA256STAMP:5ad9bd055256f1ef74c90f07b1a7afce00922aef9780fb948eecbed409f288a7 +// SHA256STAMP:a4574dbaca95afe998846ff0252826cb9ec827a614eb8018c7decfb2c863f377 diff --git a/hsmd/hsmd_wiregen.h b/hsmd/hsmd_wiregen.h index b55c47793..aff8b4c4d 100644 --- a/hsmd/hsmd_wiregen.h +++ b/hsmd/hsmd_wiregen.h @@ -295,4 +295,4 @@ bool fromwire_hsmd_sign_option_will_fund_offer_reply(const void *p, secp256k1_ec #endif /* LIGHTNING_HSMD_HSMD_WIREGEN_H */ -// SHA256STAMP:5ad9bd055256f1ef74c90f07b1a7afce00922aef9780fb948eecbed409f288a7 +// SHA256STAMP:a4574dbaca95afe998846ff0252826cb9ec827a614eb8018c7decfb2c863f377 diff --git a/lightningd/Makefile b/lightningd/Makefile index 21109e62b..2b5a59a11 100644 --- a/lightningd/Makefile +++ b/lightningd/Makefile @@ -75,8 +75,9 @@ LIGHTNINGD_COMMON_OBJS := \ common/bolt11_json.o \ common/bolt12.o \ common/bolt12_merkle.o \ - common/channel_id.o \ common/channel_config.o \ + common/channel_id.o \ + common/channel_type.o \ common/coin_mvt.o \ common/configdir.o \ common/crypto_state.o \ diff --git a/lightningd/channel.c b/lightningd/channel.c index ead10e2f2..c5eef7a43 100644 --- a/lightningd/channel.c +++ b/lightningd/channel.c @@ -284,7 +284,7 @@ struct channel *new_unsaved_channel(struct peer *peer, * | `option_anchor_outputs` */ channel->static_remotekey_start[LOCAL] = channel->static_remotekey_start[REMOTE] = 0; - channel->option_anchor_outputs = true; + channel->type = channel_type_anchor_outputs(channel); channel->future_per_commitment_point = NULL; channel->lease_commit_sig = NULL; @@ -358,7 +358,7 @@ struct channel *new_channel(struct peer *peer, u64 dbid, const u8 *remote_upfront_shutdown_script, u64 local_static_remotekey_start, u64 remote_static_remotekey_start, - bool option_anchor_outputs, + const struct channel_type *type STEALS, enum side closer, enum state_change reason, /* NULL or stolen */ @@ -454,7 +454,7 @@ struct channel *new_channel(struct peer *peer, u64 dbid, = tal_steal(channel, remote_upfront_shutdown_script); channel->static_remotekey_start[LOCAL] = local_static_remotekey_start; channel->static_remotekey_start[REMOTE] = remote_static_remotekey_start; - channel->option_anchor_outputs = option_anchor_outputs; + channel->type = tal_steal(channel, type); channel->forgets = tal_arr(channel, struct command *, 0); channel->lease_expiry = lease_expiry; diff --git a/lightningd/channel.h b/lightningd/channel.h index 8c54a7db5..eb7988a7d 100644 --- a/lightningd/channel.h +++ b/lightningd/channel.h @@ -3,6 +3,7 @@ #include "config.h" #include #include +#include #include #include #include @@ -204,8 +205,8 @@ struct channel { /* At what commit numbers does `option_static_remotekey` apply? */ u64 static_remotekey_start[NUM_SIDES]; - /* Was this negotiated with `option_anchor_outputs? */ - bool option_anchor_outputs; + /* What features apply to this channel? */ + const struct channel_type *type; /* Any commands trying to forget us. */ struct command **forgets; @@ -294,7 +295,7 @@ struct channel *new_channel(struct peer *peer, u64 dbid, const u8 *remote_upfront_shutdown_script STEALS, u64 local_static_remotekey_start, u64 remote_static_remotekey_start, - bool option_anchor_outputs, + const struct channel_type *type STEALS, enum side closer, enum state_change reason, /* NULL or stolen */ @@ -451,6 +452,11 @@ static inline bool channel_closed(const struct channel *channel) || channel->state == CLOSED; } +static inline bool channel_has(const struct channel *channel, int f) +{ + return channel_type_has(channel->type, f); +} + void get_channel_basepoints(struct lightningd *ld, const struct node_id *peer_id, const u64 dbid, diff --git a/lightningd/channel_control.c b/lightningd/channel_control.c index de95ef90f..7ab03b5ef 100644 --- a/lightningd/channel_control.c +++ b/lightningd/channel_control.c @@ -431,14 +431,32 @@ void forget_channel(struct channel *channel, const char *why) static void handle_channel_upgrade(struct channel *channel, const u8 *msg) { - bool option_static_remotekey; + struct channel_type *newtype; - if (!fromwire_channeld_upgraded(msg, &option_static_remotekey)) { + if (!fromwire_channeld_upgraded(msg, msg, &newtype)) { channel_internal_error(channel, "bad handle_channel_upgrade: %s", tal_hex(tmpctx, msg)); return; } + /* You can currently only upgrade to turn on option_static_remotekey: + * if they somehow thought anything else we need to close channel! */ + if (channel->static_remotekey_start[LOCAL] != 0x7FFFFFFFFFFFFFFFULL) { + channel_internal_error(channel, + "channel_upgrade already static_remotekey? %s", + tal_hex(tmpctx, msg)); + return; + } + + if (!channel_type_eq(newtype, channel_type_static_remotekey(tmpctx))) { + channel_internal_error(channel, + "channel_upgrade must be static_remotekey, not %s", + fmt_featurebits(tmpctx, newtype->features)); + return; + } + + tal_free(channel->type); + channel->type = channel_type_dup(channel, newtype); channel->static_remotekey_start[LOCAL] = channel->next_index[LOCAL]; channel->static_remotekey_start[REMOTE] = channel->next_index[REMOTE]; log_debug(channel->log, @@ -692,10 +710,7 @@ void peer_start_channeld(struct channel *channel, channel->remote_upfront_shutdown_script, remote_ann_node_sig, remote_ann_bitcoin_sig, - /* Set at channel open, even if not - * negotiated now! */ - channel->next_index[LOCAL] >= channel->static_remotekey_start[LOCAL], - channel->option_anchor_outputs, + channel->type, IFDEV(ld->dev_fast_gossip, false), IFDEV(dev_fail_process_onionpacket, false), pbases, diff --git a/lightningd/closing_control.c b/lightningd/closing_control.c index ccf189a99..f9e9f9ac0 100644 --- a/lightningd/closing_control.c +++ b/lightningd/closing_control.c @@ -199,6 +199,7 @@ void peer_start_closingd(struct channel *channel, int hsmfd; struct lightningd *ld = channel->peer->ld; u32 final_commit_feerate; + bool option_anchor_outputs = channel_has(channel, OPT_ANCHOR_OUTPUTS); if (!channel->shutdown_scriptpubkey[REMOTE]) { channel_internal_error(channel, @@ -243,7 +244,7 @@ void peer_start_closingd(struct channel *channel, final_commit_feerate = get_feerate(channel->fee_states, channel->opener, LOCAL); feelimit = commit_tx_base_fee(final_commit_feerate, 0, - channel->option_anchor_outputs); + option_anchor_outputs); /* If we can't determine feerate, start at half unilateral feerate. */ feerate = mutual_close_feerate(ld->topology); @@ -255,7 +256,7 @@ void peer_start_closingd(struct channel *channel, /* We use a feerate if anchor_outputs, otherwise max fee is set by * the final unilateral. */ - if (channel->option_anchor_outputs) { + if (option_anchor_outputs) { max_feerate = tal(tmpctx, u32); /* Aim for reasonable max, but use final if we don't know. */ *max_feerate = unilateral_feerate(ld->topology); @@ -316,7 +317,7 @@ void peer_start_closingd(struct channel *channel, (channel->closing_fee_negotiation_step == 50 && channel->closing_fee_negotiation_step_unit == CLOSING_FEE_NEGOTIATION_STEP_UNIT_PERCENTAGE) /* Always use quickclose with anchors */ - || channel->option_anchor_outputs, + || option_anchor_outputs, IFDEV(ld->dev_fast_gossip, false), channel->shutdown_wrong_funding); diff --git a/lightningd/onchain_control.c b/lightningd/onchain_control.c index 33faacbd2..cc46f927b 100644 --- a/lightningd/onchain_control.c +++ b/lightningd/onchain_control.c @@ -705,7 +705,7 @@ enum watch_result onchaind_funding_spent(struct channel *channel, &channel->channel_info.remote_fundingkey, channel->static_remotekey_start[LOCAL], channel->static_remotekey_start[REMOTE], - channel->option_anchor_outputs, + channel_has(channel, OPT_ANCHOR_OUTPUTS), is_replay, feerate_min(ld, NULL)); subd_send_msg(channel->owner, take(msg)); diff --git a/lightningd/opening_control.c b/lightningd/opening_control.c index a5ba1b7db..339e66672 100644 --- a/lightningd/opening_control.c +++ b/lightningd/opening_control.c @@ -105,7 +105,7 @@ wallet_commit_channel(struct lightningd *ld, struct amount_sat local_funding; s64 final_key_idx; u64 static_remotekey_start; - bool option_anchor_outputs; + struct channel_type *type; u32 lease_start_blockheight = 0; /* No leases on v1 */ /* We cannot both be the fundee *and* have a `fundchannel_start` @@ -161,18 +161,13 @@ wallet_commit_channel(struct lightningd *ld, * - MUST use that `channel_type` for all commitment transactions. */ /* i.e. We set it now for the channel permanently. */ - if (feature_negotiated(ld->our_features, - uc->peer->their_features, - OPT_STATIC_REMOTEKEY)) + type = default_channel_type(NULL, + ld->our_features, uc->peer->their_features); + if (channel_type_has(type, OPT_STATIC_REMOTEKEY)) static_remotekey_start = 0; else static_remotekey_start = 0x7FFFFFFFFFFFFFFF; - option_anchor_outputs - = feature_negotiated(ld->our_features, - uc->peer->their_features, - OPT_ANCHOR_OUTPUTS); - channel = new_channel(uc->peer, uc->dbid, NULL, /* No shachain yet */ CHANNELD_AWAITING_LOCKIN, @@ -221,7 +216,7 @@ wallet_commit_channel(struct lightningd *ld, ld->config.fee_per_satoshi, remote_upfront_shutdown_script, static_remotekey_start, static_remotekey_start, - option_anchor_outputs, + type, NUM_SIDES, /* closer not yet known */ uc->fc ? REASON_USER : REASON_REMOTE, NULL, diff --git a/lightningd/peer_control.c b/lightningd/peer_control.c index 98b79493f..fd6e49b25 100644 --- a/lightningd/peer_control.c +++ b/lightningd/peer_control.c @@ -504,7 +504,7 @@ static void json_add_htlcs(struct lightningd *ld, htlc_state_name(hin->hstate)); if (htlc_is_trimmed(REMOTE, hin->msat, local_feerate, channel->our_config.dust_limit, LOCAL, - channel->option_anchor_outputs)) + channel_has(channel, OPT_ANCHOR_OUTPUTS))) json_add_bool(response, "local_trimmed", true); if (hin->status != NULL) json_add_string(response, "status", hin->status); @@ -528,7 +528,7 @@ static void json_add_htlcs(struct lightningd *ld, htlc_state_name(hout->hstate)); if (htlc_is_trimmed(LOCAL, hout->msat, local_feerate, channel->our_config.dust_limit, LOCAL, - channel->option_anchor_outputs)) + channel_has(channel, OPT_ANCHOR_OUTPUTS))) json_add_bool(response, "local_trimmed", true); json_object_end(response); } @@ -563,6 +563,7 @@ static struct amount_sat commit_txfee(const struct channel *channel, channel->opener, side); struct amount_sat dust_limit; struct amount_sat fee; + bool option_anchor_outputs = channel_has(channel, OPT_ANCHOR_OUTPUTS); if (side == LOCAL) dust_limit = channel->our_config.dust_limit; @@ -571,7 +572,7 @@ static struct amount_sat commit_txfee(const struct channel *channel, /* Assume we tried to add "amount" */ if (!htlc_is_trimmed(side, amount, feerate, dust_limit, side, - channel->option_anchor_outputs)) + option_anchor_outputs)) num_untrimmed_htlcs++; for (hin = htlc_in_map_first(&ld->htlcs_in, &ini); @@ -580,8 +581,7 @@ static struct amount_sat commit_txfee(const struct channel *channel, if (hin->key.channel != channel) continue; if (!htlc_is_trimmed(!side, hin->msat, feerate, dust_limit, - side, - channel->option_anchor_outputs)) + side, option_anchor_outputs)) num_untrimmed_htlcs++; } for (hout = htlc_out_map_first(&ld->htlcs_out, &outi); @@ -590,8 +590,7 @@ static struct amount_sat commit_txfee(const struct channel *channel, if (hout->key.channel != channel) continue; if (!htlc_is_trimmed(side, hout->msat, feerate, dust_limit, - side, - channel->option_anchor_outputs)) + side, option_anchor_outputs)) num_untrimmed_htlcs++; } @@ -608,9 +607,9 @@ static struct amount_sat commit_txfee(const struct channel *channel, * predictability between implementations. */ fee = commit_tx_base_fee(2 * feerate, num_untrimmed_htlcs + 1, - channel->option_anchor_outputs); + option_anchor_outputs); - if (channel->option_anchor_outputs) { + if (option_anchor_outputs) { /* BOLT #3: * If `option_anchors` applies to the commitment * transaction, also subtract two times the fixed anchor size @@ -854,9 +853,9 @@ static void json_add_channel(struct lightningd *ld, json_add_null(response, "closer"); json_array_start(response, "features"); - if (channel->static_remotekey_start[LOCAL] != 0x7FFFFFFFFFFFFFFF) + if (channel_has(channel, OPT_STATIC_REMOTEKEY)) json_add_string(response, NULL, "option_static_remotekey"); - if (channel->option_anchor_outputs) + if (channel_has(channel, OPT_ANCHOR_OUTPUTS)) json_add_string(response, NULL, "option_anchor_outputs"); json_array_end(response); diff --git a/lightningd/peer_htlcs.c b/lightningd/peer_htlcs.c index 3ae970d44..518c7f87f 100644 --- a/lightningd/peer_htlcs.c +++ b/lightningd/peer_htlcs.c @@ -1127,7 +1127,6 @@ static bool ecdh_maybe_blinding(const struct pubkey *ephemeral_key, return true; } -/* AUTODATA wants a different line number */ REGISTER_PLUGIN_HOOK(htlc_accepted, htlc_accepted_hook_deserialize, htlc_accepted_hook_final, diff --git a/lightningd/test/run-invoice-select-inchan.c b/lightningd/test/run-invoice-select-inchan.c index 5a44a0db4..9e36d9e19 100644 --- a/lightningd/test/run-invoice-select-inchan.c +++ b/lightningd/test/run-invoice-select-inchan.c @@ -121,6 +121,9 @@ bool channel_tell_depth(struct lightningd *ld UNNEEDED, const struct bitcoin_txid *txid UNNEEDED, u32 depth UNNEEDED) { fprintf(stderr, "channel_tell_depth called!\n"); abort(); } +/* Generated stub for channel_type_has */ +bool channel_type_has(const struct channel_type *type UNNEEDED, int feature UNNEEDED) +{ fprintf(stderr, "channel_type_has called!\n"); abort(); } /* Generated stub for channel_unsaved_close_conn */ void channel_unsaved_close_conn(struct channel *channel UNNEEDED, const char *why UNNEEDED) { fprintf(stderr, "channel_unsaved_close_conn called!\n"); abort(); } diff --git a/onchaind/onchaind_wiregen.c b/onchaind/onchaind_wiregen.c index 8e7054165..f129790b2 100644 --- a/onchaind/onchaind_wiregen.c +++ b/onchaind/onchaind_wiregen.c @@ -639,4 +639,4 @@ bool fromwire_onchaind_notify_coin_mvt(const void *p, struct chain_coin_mvt *mvt fromwire_chain_coin_mvt(&cursor, &plen, mvt); return cursor != NULL; } -// SHA256STAMP:20dc7be2811008cab3f7d2ddafb6c8496c9e8fcf91d00cb770c2f4b7f2038ff6 +// SHA256STAMP:bc0704404825187064ec3c7721098bdf5f2ccf07e9b7c3262474f3c8275f5a40 diff --git a/onchaind/onchaind_wiregen.h b/onchaind/onchaind_wiregen.h index f342c69c4..1eeab41ba 100644 --- a/onchaind/onchaind_wiregen.h +++ b/onchaind/onchaind_wiregen.h @@ -161,4 +161,4 @@ bool fromwire_onchaind_notify_coin_mvt(const void *p, struct chain_coin_mvt *mvt #endif /* LIGHTNING_ONCHAIND_ONCHAIND_WIREGEN_H */ -// SHA256STAMP:20dc7be2811008cab3f7d2ddafb6c8496c9e8fcf91d00cb770c2f4b7f2038ff6 +// SHA256STAMP:bc0704404825187064ec3c7721098bdf5f2ccf07e9b7c3262474f3c8275f5a40 diff --git a/openingd/dualopend_wiregen.c b/openingd/dualopend_wiregen.c index aeec43288..9c2f01562 100644 --- a/openingd/dualopend_wiregen.c +++ b/openingd/dualopend_wiregen.c @@ -1051,4 +1051,4 @@ bool fromwire_dualopend_validate_lease_reply(const tal_t *ctx, const void *p, wi } return cursor != NULL; } -// SHA256STAMP:c698a54fc29460937c0acb7747670f756df42d10b6cb2fe1d3676dd9c045eb4b +// SHA256STAMP:4f00f3d34c3e8137837cf975ff52c868901b17ce0bc72efa61a561b0bb29fb07 diff --git a/openingd/dualopend_wiregen.h b/openingd/dualopend_wiregen.h index f821460f3..76e9ba059 100644 --- a/openingd/dualopend_wiregen.h +++ b/openingd/dualopend_wiregen.h @@ -225,4 +225,4 @@ bool fromwire_dualopend_validate_lease_reply(const tal_t *ctx, const void *p, wi #endif /* LIGHTNING_OPENINGD_DUALOPEND_WIREGEN_H */ -// SHA256STAMP:c698a54fc29460937c0acb7747670f756df42d10b6cb2fe1d3676dd9c045eb4b +// SHA256STAMP:4f00f3d34c3e8137837cf975ff52c868901b17ce0bc72efa61a561b0bb29fb07 diff --git a/openingd/openingd_wiregen.c b/openingd/openingd_wiregen.c index c07795698..db9ffd243 100644 --- a/openingd/openingd_wiregen.c +++ b/openingd/openingd_wiregen.c @@ -600,4 +600,4 @@ bool fromwire_openingd_dev_memleak_reply(const void *p, bool *leak) *leak = fromwire_bool(&cursor, &plen); return cursor != NULL; } -// SHA256STAMP:5af57506d50a0146a11775226d2f4a265ab1d689eabda9a2244ae87013330034 +// SHA256STAMP:d29170ad38f0c5273930ae4c87ab3ce075af9671d16f3977d5db7584f3fde1b9 diff --git a/openingd/openingd_wiregen.h b/openingd/openingd_wiregen.h index fdf8a314f..6f493ba2f 100644 --- a/openingd/openingd_wiregen.h +++ b/openingd/openingd_wiregen.h @@ -128,4 +128,4 @@ bool fromwire_openingd_dev_memleak_reply(const void *p, bool *leak); #endif /* LIGHTNING_OPENINGD_OPENINGD_WIREGEN_H */ -// SHA256STAMP:5af57506d50a0146a11775226d2f4a265ab1d689eabda9a2244ae87013330034 +// SHA256STAMP:d29170ad38f0c5273930ae4c87ab3ce075af9671d16f3977d5db7584f3fde1b9 diff --git a/tools/generate-wire.py b/tools/generate-wire.py index 33a601d51..9698eb09c 100755 --- a/tools/generate-wire.py +++ b/tools/generate-wire.py @@ -220,6 +220,7 @@ class Type(FieldSet): # Externally defined variable size types (require a context) varsize_types = [ 'peer_features', + 'channel_type', 'gossip_getnodes_entry', 'gossip_getchannels_entry', 'failed_htlc', diff --git a/wallet/db_postgres_sqlgen.c b/wallet/db_postgres_sqlgen.c index 6ca03f26a..ce2e74609 100644 --- a/wallet/db_postgres_sqlgen.c +++ b/wallet/db_postgres_sqlgen.c @@ -2074,4 +2074,4 @@ struct db_query db_postgres_queries[] = { #endif /* LIGHTNINGD_WALLET_GEN_DB_POSTGRES */ -// SHA256STAMP:f929ee6db13bdf55b5e0cdf54840091948b664a61c63a4aaaef403dc7e6f23ad +// SHA256STAMP:a70af01d3b2f3a7003703b7feb0b2ef12359e0d2850bde1697a53780e2f5dbae diff --git a/wallet/db_sqlite3_sqlgen.c b/wallet/db_sqlite3_sqlgen.c index fa71450da..c0ff23316 100644 --- a/wallet/db_sqlite3_sqlgen.c +++ b/wallet/db_sqlite3_sqlgen.c @@ -2074,4 +2074,4 @@ struct db_query db_sqlite3_queries[] = { #endif /* LIGHTNINGD_WALLET_GEN_DB_SQLITE3 */ -// SHA256STAMP:f929ee6db13bdf55b5e0cdf54840091948b664a61c63a4aaaef403dc7e6f23ad +// SHA256STAMP:a70af01d3b2f3a7003703b7feb0b2ef12359e0d2850bde1697a53780e2f5dbae diff --git a/wallet/statements_gettextgen.po b/wallet/statements_gettextgen.po index a0bff95df..570d63d84 100644 --- a/wallet/statements_gettextgen.po +++ b/wallet/statements_gettextgen.po @@ -938,419 +938,419 @@ msgstr "" msgid "SELECT funding_tx_id, funding_tx_outnum, funding_feerate, funding_satoshi, our_funding_satoshi, funding_psbt, last_tx, last_sig, funding_tx_remote_sigs_received, lease_expiry, lease_commit_sig, lease_chan_max_msat, lease_chan_max_ppt, lease_blockheight_start FROM channel_funding_inflights WHERE channel_id = ? ORDER BY funding_feerate" msgstr "" -#: wallet/wallet.c:1453 +#: wallet/wallet.c:1461 msgid "SELECT id FROM channels ORDER BY id DESC LIMIT 1;" msgstr "" -#: wallet/wallet.c:1470 +#: wallet/wallet.c:1478 msgid "SELECT id, peer_id, short_channel_id, full_channel_id, channel_config_local, channel_config_remote, state, funder, channel_flags, minimum_depth, next_index_local, next_index_remote, next_htlc_id, funding_tx_id, funding_tx_outnum, funding_satoshi, our_funding_satoshi, funding_locked_remote, push_msatoshi, msatoshi_local, fundingkey_remote, revocation_basepoint_remote, payment_basepoint_remote, htlc_basepoint_remote, delayed_payment_basepoint_remote, per_commit_remote, old_per_commit_remote, local_feerate_per_kw, remote_feerate_per_kw, shachain_remote_id, shutdown_scriptpubkey_remote, shutdown_keyidx_local, last_sent_commit_state, last_sent_commit_id, last_tx, last_sig, last_was_revoke, first_blocknum, min_possible_feerate, max_possible_feerate, msatoshi_to_us_min, msatoshi_to_us_max, future_per_commitment_point, last_sent_commit, feerate_base, feerate_ppm, remote_upfront_shutdown_script, local_static_remotekey_start, remote_static_remotekey_start, option_anchor_outputs, shutdown_scriptpubkey_local, closer, state_change_reason, revocation_basepoint_local, payment_basepoint_local, htlc_basepoint_local, delayed_payment_basepoint_local, funding_pubkey_local, shutdown_wrong_txid, shutdown_wrong_outnum, lease_expiry, lease_commit_sig, lease_chan_max_msat, lease_chan_max_ppt FROM channels WHERE state != ?;" msgstr "" -#: wallet/wallet.c:1582 +#: wallet/wallet.c:1590 msgid "UPDATE channels SET in_payments_offered = COALESCE(in_payments_offered, 0) + 1 , in_msatoshi_offered = COALESCE(in_msatoshi_offered, 0) + ? WHERE id = ?;" msgstr "" -#: wallet/wallet.c:1588 +#: wallet/wallet.c:1596 msgid "UPDATE channels SET in_payments_fulfilled = COALESCE(in_payments_fulfilled, 0) + 1 , in_msatoshi_fulfilled = COALESCE(in_msatoshi_fulfilled, 0) + ? WHERE id = ?;" msgstr "" -#: wallet/wallet.c:1594 +#: wallet/wallet.c:1602 msgid "UPDATE channels SET out_payments_offered = COALESCE(out_payments_offered, 0) + 1 , out_msatoshi_offered = COALESCE(out_msatoshi_offered, 0) + ? WHERE id = ?;" msgstr "" -#: wallet/wallet.c:1600 +#: wallet/wallet.c:1608 msgid "UPDATE channels SET out_payments_fulfilled = COALESCE(out_payments_fulfilled, 0) + 1 , out_msatoshi_fulfilled = COALESCE(out_msatoshi_fulfilled, 0) + ? WHERE id = ?;" msgstr "" -#: wallet/wallet.c:1645 +#: wallet/wallet.c:1653 msgid "SELECT in_payments_offered, in_payments_fulfilled, in_msatoshi_offered, in_msatoshi_fulfilled, out_payments_offered, out_payments_fulfilled, out_msatoshi_offered, out_msatoshi_fulfilled FROM channels WHERE id = ?" msgstr "" -#: wallet/wallet.c:1674 +#: wallet/wallet.c:1682 msgid "SELECT MIN(height), MAX(height) FROM blocks;" msgstr "" -#: wallet/wallet.c:1696 +#: wallet/wallet.c:1704 msgid "INSERT INTO channel_configs DEFAULT VALUES;" msgstr "" -#: wallet/wallet.c:1708 +#: wallet/wallet.c:1716 msgid "UPDATE channel_configs SET dust_limit_satoshis=?, max_htlc_value_in_flight_msat=?, channel_reserve_satoshis=?, htlc_minimum_msat=?, to_self_delay=?, max_accepted_htlcs=? WHERE id=?;" msgstr "" -#: wallet/wallet.c:1732 +#: wallet/wallet.c:1740 msgid "SELECT id, dust_limit_satoshis, max_htlc_value_in_flight_msat, channel_reserve_satoshis, htlc_minimum_msat, to_self_delay, max_accepted_htlcs FROM channel_configs WHERE id= ? ;" msgstr "" -#: wallet/wallet.c:1766 +#: wallet/wallet.c:1774 msgid "UPDATE channels SET remote_ann_node_sig=?, remote_ann_bitcoin_sig=? WHERE id=?" msgstr "" -#: wallet/wallet.c:1785 +#: wallet/wallet.c:1793 msgid "UPDATE channels SET shachain_remote_id=?, short_channel_id=?, full_channel_id=?, state=?, funder=?, channel_flags=?, minimum_depth=?, next_index_local=?, next_index_remote=?, next_htlc_id=?, funding_tx_id=?, funding_tx_outnum=?, funding_satoshi=?, our_funding_satoshi=?, funding_locked_remote=?, push_msatoshi=?, msatoshi_local=?, shutdown_scriptpubkey_remote=?, shutdown_keyidx_local=?, channel_config_local=?, last_tx=?, last_sig=?, last_was_revoke=?, min_possible_feerate=?, max_possible_feerate=?, msatoshi_to_us_min=?, msatoshi_to_us_max=?, feerate_base=?, feerate_ppm=?, remote_upfront_shutdown_script=?, local_static_remotekey_start=?, remote_static_remotekey_start=?, option_anchor_outputs=?, shutdown_scriptpubkey_local=?, closer=?, state_change_reason=?, shutdown_wrong_txid=?, shutdown_wrong_outnum=?, lease_expiry=?, lease_commit_sig=?, lease_chan_max_msat=?, lease_chan_max_ppt=? WHERE id=?" msgstr "" -#: wallet/wallet.c:1894 +#: wallet/wallet.c:1902 msgid "UPDATE channels SET fundingkey_remote=?, revocation_basepoint_remote=?, payment_basepoint_remote=?, htlc_basepoint_remote=?, delayed_payment_basepoint_remote=?, per_commit_remote=?, old_per_commit_remote=?, channel_config_remote=?, future_per_commitment_point=? WHERE id=?" msgstr "" -#: wallet/wallet.c:1921 +#: wallet/wallet.c:1929 msgid "DELETE FROM channel_feerates WHERE channel_id=?" msgstr "" -#: wallet/wallet.c:1931 +#: wallet/wallet.c:1939 msgid "INSERT INTO channel_feerates VALUES(?, ?, ?)" msgstr "" -#: wallet/wallet.c:1940 +#: wallet/wallet.c:1948 msgid "DELETE FROM channel_blockheights WHERE channel_id=?" msgstr "" -#: wallet/wallet.c:1950 +#: wallet/wallet.c:1958 msgid "INSERT INTO channel_blockheights VALUES(?, ?, ?)" msgstr "" -#: wallet/wallet.c:1967 +#: wallet/wallet.c:1975 msgid "UPDATE channels SET last_sent_commit=? WHERE id=?" msgstr "" -#: wallet/wallet.c:1990 +#: wallet/wallet.c:1998 msgid "INSERT INTO channel_state_changes ( channel_id, timestamp, old_state, new_state, cause, message) VALUES (?, ?, ?, ?, ?, ?);" msgstr "" -#: wallet/wallet.c:2018 +#: wallet/wallet.c:2026 msgid "SELECT timestamp, old_state, new_state, cause, message FROM channel_state_changes WHERE channel_id = ? ORDER BY timestamp ASC;" msgstr "" -#: wallet/wallet.c:2047 +#: wallet/wallet.c:2055 msgid "SELECT id FROM peers WHERE node_id = ?" msgstr "" -#: wallet/wallet.c:2059 +#: wallet/wallet.c:2067 msgid "UPDATE peers SET address = ? WHERE id = ?" msgstr "" -#: wallet/wallet.c:2068 +#: wallet/wallet.c:2076 msgid "INSERT INTO peers (node_id, address) VALUES (?, ?);" msgstr "" -#: wallet/wallet.c:2089 +#: wallet/wallet.c:2097 msgid "INSERT INTO channels ( peer_id, first_blocknum, id, revocation_basepoint_local, payment_basepoint_local, htlc_basepoint_local, delayed_payment_basepoint_local, funding_pubkey_local) VALUES (?, ?, ?, ?, ?, ?, ?, ?);" msgstr "" -#: wallet/wallet.c:2130 +#: wallet/wallet.c:2138 msgid "DELETE FROM channel_htlcs WHERE channel_id=?" msgstr "" -#: wallet/wallet.c:2136 +#: wallet/wallet.c:2144 msgid "DELETE FROM htlc_sigs WHERE channelid=?" msgstr "" -#: wallet/wallet.c:2142 +#: wallet/wallet.c:2150 msgid "DELETE FROM channeltxs WHERE channel_id=?" msgstr "" -#: wallet/wallet.c:2149 +#: wallet/wallet.c:2157 msgid "DELETE FROM channel_funding_inflights WHERE channel_id=?" msgstr "" -#: wallet/wallet.c:2155 +#: wallet/wallet.c:2163 msgid "DELETE FROM shachains WHERE id IN ( SELECT shachain_remote_id FROM channels WHERE channels.id=?)" msgstr "" -#: wallet/wallet.c:2165 +#: wallet/wallet.c:2173 msgid "UPDATE channels SET state=?, peer_id=? WHERE channels.id=?" msgstr "" -#: wallet/wallet.c:2179 +#: wallet/wallet.c:2187 msgid "SELECT * FROM channels WHERE peer_id = ?;" msgstr "" -#: wallet/wallet.c:2187 +#: wallet/wallet.c:2195 msgid "DELETE FROM peers WHERE id=?" msgstr "" -#: wallet/wallet.c:2198 +#: wallet/wallet.c:2206 msgid "UPDATE outputs SET confirmation_height = ? WHERE prev_out_tx = ?" msgstr "" -#: wallet/wallet.c:2301 +#: wallet/wallet.c:2309 msgid "INSERT INTO channel_htlcs ( channel_id, channel_htlc_id, direction, msatoshi, cltv_expiry, payment_hash, payment_key, hstate, shared_secret, routing_onion, received_time) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);" msgstr "" -#: wallet/wallet.c:2354 +#: wallet/wallet.c:2362 msgid "INSERT INTO channel_htlcs ( channel_id, channel_htlc_id, direction, origin_htlc, msatoshi, cltv_expiry, payment_hash, payment_key, hstate, routing_onion, malformed_onion, partid) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 0, ?);" msgstr "" -#: wallet/wallet.c:2415 +#: wallet/wallet.c:2423 msgid "UPDATE channel_htlcs SET hstate=?, payment_key=?, malformed_onion=?, failuremsg=?, localfailmsg=?, we_filled=? WHERE id=?" msgstr "" -#: wallet/wallet.c:2632 +#: wallet/wallet.c:2640 msgid "SELECT id, channel_htlc_id, msatoshi, cltv_expiry, hstate, payment_hash, payment_key, routing_onion, failuremsg, malformed_onion, origin_htlc, shared_secret, received_time, we_filled FROM channel_htlcs WHERE direction= ? AND channel_id= ? AND hstate != ?" msgstr "" -#: wallet/wallet.c:2679 +#: wallet/wallet.c:2687 msgid "SELECT id, channel_htlc_id, msatoshi, cltv_expiry, hstate, payment_hash, payment_key, routing_onion, failuremsg, malformed_onion, origin_htlc, shared_secret, received_time, partid, localfailmsg FROM channel_htlcs WHERE direction = ? AND channel_id = ? AND hstate != ?" msgstr "" -#: wallet/wallet.c:2810 +#: wallet/wallet.c:2818 msgid "SELECT channel_id, direction, cltv_expiry, channel_htlc_id, payment_hash FROM channel_htlcs WHERE channel_id = ?;" msgstr "" -#: wallet/wallet.c:2844 +#: wallet/wallet.c:2852 msgid "DELETE FROM channel_htlcs WHERE direction = ? AND origin_htlc = ? AND payment_hash = ? AND partid = ?;" msgstr "" -#: wallet/wallet.c:2897 +#: wallet/wallet.c:2905 msgid "SELECT status FROM payments WHERE payment_hash=? AND partid = ?;" msgstr "" -#: wallet/wallet.c:2915 +#: wallet/wallet.c:2923 msgid "INSERT INTO payments ( status, payment_hash, destination, msatoshi, timestamp, path_secrets, route_nodes, route_channels, msatoshi_sent, description, bolt11, total_msat, partid, local_offer_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);" msgstr "" -#: wallet/wallet.c:3004 +#: wallet/wallet.c:3012 msgid "DELETE FROM payments WHERE payment_hash = ? AND partid = ?" msgstr "" -#: wallet/wallet.c:3018 +#: wallet/wallet.c:3026 msgid "DELETE FROM payments WHERE payment_hash = ?" msgstr "" -#: wallet/wallet.c:3119 +#: wallet/wallet.c:3127 msgid "SELECT id, status, destination, msatoshi, payment_hash, timestamp, payment_preimage, path_secrets, route_nodes, route_channels, msatoshi_sent, description, bolt11, failonionreply, total_msat, partid, local_offer_id FROM payments WHERE payment_hash = ? AND partid = ?" msgstr "" -#: wallet/wallet.c:3169 +#: wallet/wallet.c:3177 msgid "UPDATE payments SET status=? WHERE payment_hash=? AND partid=?" msgstr "" -#: wallet/wallet.c:3179 +#: wallet/wallet.c:3187 msgid "UPDATE payments SET payment_preimage=? WHERE payment_hash=? AND partid=?" msgstr "" -#: wallet/wallet.c:3189 +#: wallet/wallet.c:3197 msgid "UPDATE payments SET path_secrets = NULL , route_nodes = NULL , route_channels = NULL WHERE payment_hash = ? AND partid = ?;" msgstr "" -#: wallet/wallet.c:3221 +#: wallet/wallet.c:3229 msgid "SELECT failonionreply, faildestperm, failindex, failcode, failnode, failchannel, failupdate, faildetail, faildirection FROM payments WHERE payment_hash=? AND partid=?;" msgstr "" -#: wallet/wallet.c:3288 +#: wallet/wallet.c:3296 msgid "UPDATE payments SET failonionreply=? , faildestperm=? , failindex=? , failcode=? , failnode=? , failchannel=? , failupdate=? , faildetail=? , faildirection=? WHERE payment_hash=? AND partid=?;" msgstr "" -#: wallet/wallet.c:3347 +#: wallet/wallet.c:3355 msgid "SELECT id, status, destination, msatoshi, payment_hash, timestamp, payment_preimage, path_secrets, route_nodes, route_channels, msatoshi_sent, description, bolt11, failonionreply, total_msat, partid, local_offer_id FROM payments WHERE payment_hash = ? ORDER BY id;" msgstr "" -#: wallet/wallet.c:3370 +#: wallet/wallet.c:3378 msgid "SELECT id, status, destination, msatoshi, payment_hash, timestamp, payment_preimage, path_secrets, route_nodes, route_channels, msatoshi_sent, description, bolt11, failonionreply, total_msat, partid, local_offer_id FROM payments ORDER BY id;" msgstr "" -#: wallet/wallet.c:3421 +#: wallet/wallet.c:3429 msgid "SELECT id, status, destination, msatoshi, payment_hash, timestamp, payment_preimage, path_secrets, route_nodes, route_channels, msatoshi_sent, description, bolt11, failonionreply, total_msat, partid, local_offer_id FROM payments WHERE local_offer_id = ?;" msgstr "" -#: wallet/wallet.c:3466 +#: wallet/wallet.c:3474 msgid "DELETE FROM htlc_sigs WHERE channelid = ?" msgstr "" -#: wallet/wallet.c:3473 +#: wallet/wallet.c:3481 msgid "INSERT INTO htlc_sigs (channelid, signature) VALUES (?, ?)" msgstr "" -#: wallet/wallet.c:3485 +#: wallet/wallet.c:3493 msgid "SELECT blobval FROM vars WHERE name='genesis_hash'" msgstr "" -#: wallet/wallet.c:3509 +#: wallet/wallet.c:3517 msgid "INSERT INTO vars (name, blobval) VALUES ('genesis_hash', ?);" msgstr "" -#: wallet/wallet.c:3527 +#: wallet/wallet.c:3535 msgid "SELECT txid, outnum FROM utxoset WHERE spendheight < ?" msgstr "" -#: wallet/wallet.c:3539 +#: wallet/wallet.c:3547 msgid "DELETE FROM utxoset WHERE spendheight < ?" msgstr "" -#: wallet/wallet.c:3547 wallet/wallet.c:3661 +#: wallet/wallet.c:3555 wallet/wallet.c:3669 msgid "INSERT INTO blocks (height, hash, prev_hash) VALUES (?, ?, ?);" msgstr "" -#: wallet/wallet.c:3566 +#: wallet/wallet.c:3574 msgid "DELETE FROM blocks WHERE hash = ?" msgstr "" -#: wallet/wallet.c:3572 +#: wallet/wallet.c:3580 msgid "SELECT * FROM blocks WHERE height >= ?;" msgstr "" -#: wallet/wallet.c:3581 +#: wallet/wallet.c:3589 msgid "DELETE FROM blocks WHERE height > ?" msgstr "" -#: wallet/wallet.c:3593 +#: wallet/wallet.c:3601 msgid "UPDATE outputs SET spend_height = ?, status = ? WHERE prev_out_tx = ? AND prev_out_index = ?" msgstr "" -#: wallet/wallet.c:3611 +#: wallet/wallet.c:3619 msgid "UPDATE utxoset SET spendheight = ? WHERE txid = ? AND outnum = ?" msgstr "" -#: wallet/wallet.c:3634 wallet/wallet.c:3672 +#: wallet/wallet.c:3642 wallet/wallet.c:3680 msgid "INSERT INTO utxoset ( txid, outnum, blockheight, spendheight, txindex, scriptpubkey, satoshis) VALUES(?, ?, ?, ?, ?, ?, ?);" msgstr "" -#: wallet/wallet.c:3698 +#: wallet/wallet.c:3706 msgid "SELECT height FROM blocks WHERE height = ?" msgstr "" -#: wallet/wallet.c:3711 +#: wallet/wallet.c:3719 msgid "SELECT txid, spendheight, scriptpubkey, satoshis FROM utxoset WHERE blockheight = ? AND txindex = ? AND outnum = ? AND spendheight IS NULL" msgstr "" -#: wallet/wallet.c:3775 +#: wallet/wallet.c:3783 msgid "SELECT blockheight, txindex, outnum FROM utxoset WHERE spendheight = ?" msgstr "" -#: wallet/wallet.c:3792 +#: wallet/wallet.c:3800 msgid "SELECT blockheight, txindex, outnum FROM utxoset WHERE blockheight = ?" msgstr "" -#: wallet/wallet.c:3809 wallet/wallet.c:3969 +#: wallet/wallet.c:3817 wallet/wallet.c:3977 msgid "SELECT blockheight FROM transactions WHERE id=?" msgstr "" -#: wallet/wallet.c:3819 +#: wallet/wallet.c:3827 msgid "INSERT INTO transactions ( id, blockheight, txindex, rawtx) VALUES (?, ?, ?, ?);" msgstr "" -#: wallet/wallet.c:3840 +#: wallet/wallet.c:3848 msgid "UPDATE transactions SET blockheight = ?, txindex = ? WHERE id = ?" msgstr "" -#: wallet/wallet.c:3857 +#: wallet/wallet.c:3865 msgid "INSERT INTO transaction_annotations (txid, idx, location, type, channel) VALUES (?, ?, ?, ?, ?) ON CONFLICT(txid,idx) DO NOTHING;" msgstr "" -#: wallet/wallet.c:3889 +#: wallet/wallet.c:3897 msgid "SELECT type, channel_id FROM transactions WHERE id=?" msgstr "" -#: wallet/wallet.c:3905 +#: wallet/wallet.c:3913 msgid "UPDATE transactions SET type = ?, channel_id = ? WHERE id = ?" msgstr "" -#: wallet/wallet.c:3924 +#: wallet/wallet.c:3932 msgid "SELECT type FROM transactions WHERE id=?" msgstr "" -#: wallet/wallet.c:3947 +#: wallet/wallet.c:3955 msgid "SELECT rawtx FROM transactions WHERE id=?" msgstr "" -#: wallet/wallet.c:3993 +#: wallet/wallet.c:4001 msgid "SELECT blockheight, txindex FROM transactions WHERE id=?" msgstr "" -#: wallet/wallet.c:4021 +#: wallet/wallet.c:4029 msgid "SELECT id FROM transactions WHERE blockheight=?" msgstr "" -#: wallet/wallet.c:4040 +#: wallet/wallet.c:4048 msgid "INSERT INTO channeltxs ( channel_id, type, transaction_id, input_num, blockheight) VALUES (?, ?, ?, ?, ?);" msgstr "" -#: wallet/wallet.c:4064 +#: wallet/wallet.c:4072 msgid "SELECT DISTINCT(channel_id) FROM channeltxs WHERE type = ?;" msgstr "" -#: wallet/wallet.c:4085 +#: wallet/wallet.c:4093 msgid "SELECT c.type, c.blockheight, t.rawtx, c.input_num, c.blockheight - t.blockheight + 1 AS depth, t.id as txid FROM channeltxs c JOIN transactions t ON t.id = c.transaction_id WHERE c.channel_id = ? ORDER BY c.id ASC;" msgstr "" -#: wallet/wallet.c:4130 +#: wallet/wallet.c:4138 msgid "UPDATE forwarded_payments SET in_msatoshi=?, out_msatoshi=?, state=?, resolved_time=?, failcode=? WHERE in_htlc_id=?" msgstr "" -#: wallet/wallet.c:4188 +#: wallet/wallet.c:4196 msgid "INSERT INTO forwarded_payments ( in_htlc_id, out_htlc_id, in_channel_scid, out_channel_scid, in_msatoshi, out_msatoshi, state, received_time, resolved_time, failcode) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?);" msgstr "" -#: wallet/wallet.c:4247 +#: wallet/wallet.c:4255 msgid "SELECT CAST(COALESCE(SUM(in_msatoshi - out_msatoshi), 0) AS BIGINT)FROM forwarded_payments WHERE state = ?;" msgstr "" -#: wallet/wallet.c:4296 +#: wallet/wallet.c:4304 msgid "SELECT f.state, in_msatoshi, out_msatoshi, hin.payment_hash as payment_hash, in_channel_scid, out_channel_scid, f.received_time, f.resolved_time, f.failcode FROM forwarded_payments f LEFT JOIN channel_htlcs hin ON (f.in_htlc_id = hin.id) WHERE (1 = ? OR f.state = ?) AND (1 = ? OR f.in_channel_scid = ?) AND (1 = ? OR f.out_channel_scid = ?)" msgstr "" -#: wallet/wallet.c:4418 +#: wallet/wallet.c:4426 msgid "SELECT t.id, t.rawtx, t.blockheight, t.txindex, t.type as txtype, c2.short_channel_id as txchan, a.location, a.idx as ann_idx, a.type as annotation_type, c.short_channel_id FROM transactions t LEFT JOIN transaction_annotations a ON (a.txid = t.id) LEFT JOIN channels c ON (a.channel = c.id) LEFT JOIN channels c2 ON (t.channel_id = c2.id) ORDER BY t.blockheight, t.txindex ASC" msgstr "" -#: wallet/wallet.c:4512 +#: wallet/wallet.c:4520 msgid "INSERT INTO penalty_bases ( channel_id, commitnum, txid, outnum, amount) VALUES (?, ?, ?, ?, ?);" msgstr "" -#: wallet/wallet.c:4537 +#: wallet/wallet.c:4545 msgid "SELECT commitnum, txid, outnum, amount FROM penalty_bases WHERE channel_id = ?" msgstr "" -#: wallet/wallet.c:4561 +#: wallet/wallet.c:4569 msgid "DELETE FROM penalty_bases WHERE channel_id = ? AND commitnum = ?" msgstr "" -#: wallet/wallet.c:4579 +#: wallet/wallet.c:4587 msgid "SELECT 1 FROM offers WHERE offer_id = ?;" msgstr "" -#: wallet/wallet.c:4592 +#: wallet/wallet.c:4600 msgid "INSERT INTO offers ( offer_id, bolt12, label, status) VALUES (?, ?, ?, ?);" msgstr "" -#: wallet/wallet.c:4619 +#: wallet/wallet.c:4627 msgid "SELECT bolt12, label, status FROM offers WHERE offer_id = ?;" msgstr "" -#: wallet/wallet.c:4647 +#: wallet/wallet.c:4655 msgid "SELECT offer_id FROM offers;" msgstr "" -#: wallet/wallet.c:4673 +#: wallet/wallet.c:4681 msgid "UPDATE offers SET status=? WHERE offer_id = ?;" msgstr "" -#: wallet/wallet.c:4684 +#: wallet/wallet.c:4692 msgid "UPDATE invoices SET state=? WHERE state=? AND local_offer_id = ?;" msgstr "" -#: wallet/wallet.c:4712 +#: wallet/wallet.c:4720 msgid "SELECT status FROM offers WHERE offer_id = ?;" msgstr "" -#: wallet/wallet.c:4797 +#: wallet/wallet.c:4805 msgid "UPDATE datastore SET data=?, generation=generation+1 WHERE key=?;" msgstr "" -#: wallet/wallet.c:4808 +#: wallet/wallet.c:4816 msgid "INSERT INTO datastore VALUES (?, ?, 0);" msgstr "" -#: wallet/wallet.c:4819 +#: wallet/wallet.c:4827 msgid "DELETE FROM datastore WHERE key = ?" msgstr "" -#: wallet/wallet.c:4836 +#: wallet/wallet.c:4844 msgid "SELECT key, data, generation FROM datastore WHERE key >= ? ORDER BY key;" msgstr "" -#: wallet/wallet.c:4843 +#: wallet/wallet.c:4851 msgid "SELECT key, data, generation FROM datastore ORDER BY key;" msgstr "" @@ -1362,11 +1362,11 @@ msgstr "" msgid "not a valid SQL statement" msgstr "" -#: wallet/test/run-wallet.c:1545 +#: wallet/test/run-wallet.c:1541 msgid "SELECT COUNT(1) FROM channel_funding_inflights WHERE channel_id = ?;" msgstr "" -#: wallet/test/run-wallet.c:1758 +#: wallet/test/run-wallet.c:1754 msgid "INSERT INTO channels (id) VALUES (1);" msgstr "" -# SHA256STAMP:35e10cb3ec34af54b6d78d9eea1aefa0861ef9acbfe0e78745d24b8e49e50b05 +# SHA256STAMP:651a6c15e8780351cd32a4e6dc3011b1c5fc2af6308b0e65a442dda2a3874e19 diff --git a/wallet/test/Makefile b/wallet/test/Makefile index 7526ec232..6ea28e140 100644 --- a/wallet/test/Makefile +++ b/wallet/test/Makefile @@ -9,7 +9,9 @@ WALLET_TEST_COMMON_OBJS := \ common/amount.o \ common/base32.o \ common/blockheight_states.o \ + common/channel_type.o \ common/derive_basepoints.o \ + common/features.o \ common/htlc_state.o \ common/htlc_wire.o \ common/fee_states.o \ diff --git a/wallet/test/run-wallet.c b/wallet/test/run-wallet.c index 666068099..dc1417a5e 100644 --- a/wallet/test/run-wallet.c +++ b/wallet/test/run-wallet.c @@ -121,13 +121,6 @@ char *encode_scriptpubkey_to_addr(const tal_t *ctx UNNEEDED, /* Generated stub for fatal */ void fatal(const char *fmt UNNEEDED, ...) { fprintf(stderr, "fatal called!\n"); abort(); } -/* Generated stub for feature_negotiated */ -bool feature_negotiated(const struct feature_set *our_features UNNEEDED, - const u8 *their_features UNNEEDED, size_t f UNNEEDED) -{ fprintf(stderr, "feature_negotiated called!\n"); abort(); } -/* Generated stub for feature_offered */ -bool feature_offered(const u8 *features UNNEEDED, size_t f UNNEEDED) -{ fprintf(stderr, "feature_offered called!\n"); abort(); } /* Generated stub for fromwire_channeld_dev_memleak_reply */ bool fromwire_channeld_dev_memleak_reply(const void *p UNNEEDED, bool *leak UNNEEDED) { fprintf(stderr, "fromwire_channeld_dev_memleak_reply called!\n"); abort(); } @@ -1122,7 +1115,7 @@ static bool test_wallet_outputs(struct lightningd *ld, const tal_t *ctx) true, NULL); channel.peer = new_peer(ld, 0, &id, &addr, false); channel.dbid = 1; - channel.option_anchor_outputs = true; + channel.type = channel_type_anchor_outputs(tmpctx); memset(&u.txid, 3, sizeof(u.txid)); CHECK_MSG(wallet_add_onchaind_utxo(w, &u.txid, u.outnum, @@ -1359,6 +1352,7 @@ static bool channelseq(struct channel *c1, struct channel *c2) } /* c2 should also be out of inflights */ CHECK(list_next(&c2->inflights, i2, list) == NULL); + CHECK(channel_type_eq(c1->type, c2->type)); return true; } @@ -1398,6 +1392,7 @@ static bool test_channel_crud(struct lightningd *ld, const tal_t *ctx) secp256k1_ecdsa_signature *node_sig2, *bitcoin_sig2; u32 feerate, blockheight; bool load; + const struct channel_type *type = channel_type_static_remotekey(w); memset(&c1, 0, sizeof(c1)); memset(c2, 0, sizeof(*c2)); @@ -1446,6 +1441,7 @@ static bool test_channel_crud(struct lightningd *ld, const tal_t *ctx) c1.unsaved_dbid = 0; /* Init channel inflights */ list_head_init(&c1.inflights); + c1.type = type; db_begin_transaction(w->db); CHECK(!wallet_err); @@ -1640,7 +1636,7 @@ static bool test_channel_inflight_crud(struct lightningd *ld, const tal_t *ctx) &basepoints, &pk, NULL, 1000, 100, - NULL, 0, 0, true, + NULL, 0, 0, channel_type_static_remotekey(NULL), LOCAL, REASON_UNKNOWN, NULL, new_height_states(w, LOCAL, diff --git a/wallet/wallet.c b/wallet/wallet.c index fc85bd982..23a7648b6 100644 --- a/wallet/wallet.c +++ b/wallet/wallet.c @@ -652,7 +652,7 @@ bool wallet_add_onchaind_utxo(struct wallet *w, else db_bind_null(stmt, 8); - db_bind_int(stmt, 9, channel->option_anchor_outputs); + db_bind_int(stmt, 9, channel_has(channel, OPT_ANCHOR_OUTPUTS)); db_bind_int(stmt, 10, blockheight); /* spendheight */ @@ -1245,6 +1245,7 @@ static struct channel *wallet_stmt2channel(struct wallet *w, struct db_stmt *stm struct pubkey *future_per_commitment_point; struct amount_sat funding_sat, our_funding_sat; struct amount_msat push_msat, our_msat, msat_to_us_min, msat_to_us_max; + struct channel_type *type; secp256k1_ecdsa_signature *lease_commit_sig; u32 lease_chan_max_msat; u16 lease_chan_max_ppt; @@ -1381,6 +1382,13 @@ static struct channel *wallet_stmt2channel(struct wallet *w, struct db_stmt *stm lease_chan_max_ppt = 0; } + if (db_column_int(stmt, 49)) + type = channel_type_anchor_outputs(NULL); + else if (db_column_u64(stmt, 47) != 0x7FFFFFFFFFFFFFFFULL) + type = channel_type_static_remotekey(NULL); + else + type = channel_type_none(NULL); + chan = new_channel(peer, db_column_u64(stmt, 0), &wshachain, db_column_int(stmt, 6), @@ -1428,7 +1436,7 @@ static struct channel *wallet_stmt2channel(struct wallet *w, struct db_stmt *stm db_column_arr(tmpctx, stmt, 46, u8), db_column_u64(stmt, 47), db_column_u64(stmt, 48), - db_column_int(stmt, 49), + type, db_column_int(stmt, 51), db_column_int(stmt, 52), shutdown_wrong_funding, @@ -1865,7 +1873,7 @@ void wallet_channel_save(struct wallet *w, struct channel *chan) db_bind_talarr(stmt, 29, chan->remote_upfront_shutdown_script); db_bind_u64(stmt, 30, chan->static_remotekey_start[LOCAL]); db_bind_u64(stmt, 31, chan->static_remotekey_start[REMOTE]); - db_bind_int(stmt, 32, chan->option_anchor_outputs); + db_bind_int(stmt, 32, channel_has(chan, OPT_ANCHOR_OUTPUTS)); db_bind_talarr(stmt, 33, chan->shutdown_scriptpubkey[LOCAL]); db_bind_int(stmt, 34, chan->closer); db_bind_int(stmt, 35, chan->state_change_cause); diff --git a/wire/bolt12_wiregen.c b/wire/bolt12_wiregen.c index 3f40802ac..5a74d7f64 100644 --- a/wire/bolt12_wiregen.c +++ b/wire/bolt12_wiregen.c @@ -1684,4 +1684,4 @@ bool invoice_error_is_valid(const struct tlv_invoice_error *record, size_t *err_ return tlv_fields_valid(record->fields, NULL, err_index); } -// SHA256STAMP:d6c9a7b168be00b6c823052f1c62bf4fec8792ca81bc9125173af0bd357885f4 +// SHA256STAMP:148a2f3fb6e0148409b1a86d22febab73d290e33b697b803f2d46ddcb61290ac diff --git a/wire/bolt12_wiregen.h b/wire/bolt12_wiregen.h index 196514dbf..8a5ba2b5f 100644 --- a/wire/bolt12_wiregen.h +++ b/wire/bolt12_wiregen.h @@ -323,4 +323,4 @@ struct fallback_address *fromwire_fallback_address(const tal_t *ctx, const u8 ** #endif /* LIGHTNING_WIRE_BOLT12_WIREGEN_H */ -// SHA256STAMP:d6c9a7b168be00b6c823052f1c62bf4fec8792ca81bc9125173af0bd357885f4 +// SHA256STAMP:148a2f3fb6e0148409b1a86d22febab73d290e33b697b803f2d46ddcb61290ac diff --git a/wire/common_wiregen.c b/wire/common_wiregen.c index 828123f47..59bb028e3 100644 --- a/wire/common_wiregen.c +++ b/wire/common_wiregen.c @@ -100,4 +100,4 @@ bool fromwire_custommsg_out(const tal_t *ctx, const void *p, u8 **msg) fromwire_u8_array(&cursor, &plen, *msg, msg_len); return cursor != NULL; } -// SHA256STAMP:402f88d03a71eaf310e65fcd62fd87becf788a30626ed96c8eab3da538717a60 +// SHA256STAMP:fbe11d774ac183c6d77a14e451214f167d0d7205f656ddff1d6a96c40bfd0326 diff --git a/wire/common_wiregen.h b/wire/common_wiregen.h index 39baddbb2..1f9aeabb4 100644 --- a/wire/common_wiregen.h +++ b/wire/common_wiregen.h @@ -41,4 +41,4 @@ bool fromwire_custommsg_out(const tal_t *ctx, const void *p, u8 **msg); #endif /* LIGHTNING_WIRE_COMMON_WIREGEN_H */ -// SHA256STAMP:402f88d03a71eaf310e65fcd62fd87becf788a30626ed96c8eab3da538717a60 +// SHA256STAMP:fbe11d774ac183c6d77a14e451214f167d0d7205f656ddff1d6a96c40bfd0326 diff --git a/wire/onion_printgen.c b/wire/onion_printgen.c index 2ee526c71..b222a5d00 100644 --- a/wire/onion_printgen.c +++ b/wire/onion_printgen.c @@ -859,4 +859,4 @@ void printonion_wire_tlv_message(const char *tlv_name, const u8 *msg) { printwire_tlvs(tlv_name, &msg, &plen, print_tlvs_encmsg_tlvs, ARRAY_SIZE(print_tlvs_encmsg_tlvs)); } } -// SHA256STAMP:09dc1e023332a80d6e5b948472d121823404a3d7bfc843142b00ead7892148a1 +// SHA256STAMP:fd460361e76105eb612f69f2a3f27e70115c0ebdad82785f2c852c13f9c08c8d diff --git a/wire/onion_printgen.h b/wire/onion_printgen.h index 807236a2a..c803ce305 100644 --- a/wire/onion_printgen.h +++ b/wire/onion_printgen.h @@ -58,4 +58,4 @@ void printwire_mpp_timeout(const char *fieldname, const u8 *cursor); void printwire_onionmsg_path(const char *fieldname, const u8 **cursor, size_t *plen); #endif /* LIGHTNING_WIRE_ONION_PRINTGEN_H */ -// SHA256STAMP:09dc1e023332a80d6e5b948472d121823404a3d7bfc843142b00ead7892148a1 +// SHA256STAMP:fd460361e76105eb612f69f2a3f27e70115c0ebdad82785f2c852c13f9c08c8d diff --git a/wire/onion_wiregen.c b/wire/onion_wiregen.c index 6f0d3f443..c8493d56e 100644 --- a/wire/onion_wiregen.c +++ b/wire/onion_wiregen.c @@ -1026,4 +1026,4 @@ bool fromwire_mpp_timeout(const void *p) return false; return cursor != NULL; } -// SHA256STAMP:09dc1e023332a80d6e5b948472d121823404a3d7bfc843142b00ead7892148a1 +// SHA256STAMP:fd460361e76105eb612f69f2a3f27e70115c0ebdad82785f2c852c13f9c08c8d diff --git a/wire/onion_wiregen.h b/wire/onion_wiregen.h index 7a548eced..58c0d83f8 100644 --- a/wire/onion_wiregen.h +++ b/wire/onion_wiregen.h @@ -317,4 +317,4 @@ bool fromwire_mpp_timeout(const void *p); #endif /* LIGHTNING_WIRE_ONION_WIREGEN_H */ -// SHA256STAMP:09dc1e023332a80d6e5b948472d121823404a3d7bfc843142b00ead7892148a1 +// SHA256STAMP:fd460361e76105eb612f69f2a3f27e70115c0ebdad82785f2c852c13f9c08c8d diff --git a/wire/peer_printgen.c b/wire/peer_printgen.c index 7567cbaff..92725c193 100644 --- a/wire/peer_printgen.c +++ b/wire/peer_printgen.c @@ -3139,4 +3139,4 @@ void printpeer_wire_tlv_message(const char *tlv_name, const u8 *msg) { printwire_tlvs(tlv_name, &msg, &plen, print_tlvs_onion_message_tlvs, ARRAY_SIZE(print_tlvs_onion_message_tlvs)); } } -// SHA256STAMP:594dbd4e700334431fccd0dc7bd7ef22ca033299d24ba92f920601a807291c64 +// SHA256STAMP:d2dbf0b5768a6a6c940a353621f8a0521f49104c99d7f5d350c500587a7d54c4 diff --git a/wire/peer_printgen.h b/wire/peer_printgen.h index 87df04cdd..e23e2d9cd 100644 --- a/wire/peer_printgen.h +++ b/wire/peer_printgen.h @@ -99,4 +99,4 @@ void printwire_channel_update_checksums(const char *fieldname, const u8 **cursor void printwire_channel_update_timestamps(const char *fieldname, const u8 **cursor, size_t *plen); void printwire_witness_stack(const char *fieldname, const u8 **cursor, size_t *plen); #endif /* LIGHTNING_WIRE_PEER_PRINTGEN_H */ -// SHA256STAMP:594dbd4e700334431fccd0dc7bd7ef22ca033299d24ba92f920601a807291c64 +// SHA256STAMP:d2dbf0b5768a6a6c940a353621f8a0521f49104c99d7f5d350c500587a7d54c4 diff --git a/wire/peer_wiregen.c b/wire/peer_wiregen.c index c90eaa78b..573d42bd3 100644 --- a/wire/peer_wiregen.c +++ b/wire/peer_wiregen.c @@ -2589,4 +2589,4 @@ bool fromwire_channel_update_option_channel_htlc_max(const void *p, secp256k1_ec *htlc_maximum_msat = fromwire_amount_msat(&cursor, &plen); return cursor != NULL; } -// SHA256STAMP:594dbd4e700334431fccd0dc7bd7ef22ca033299d24ba92f920601a807291c64 +// SHA256STAMP:d2dbf0b5768a6a6c940a353621f8a0521f49104c99d7f5d350c500587a7d54c4 diff --git a/wire/peer_wiregen.h b/wire/peer_wiregen.h index 6704f262b..bfbc713a2 100644 --- a/wire/peer_wiregen.h +++ b/wire/peer_wiregen.h @@ -981,4 +981,4 @@ bool fromwire_channel_update_option_channel_htlc_max(const void *p, secp256k1_ec #endif /* LIGHTNING_WIRE_PEER_WIREGEN_H */ -// SHA256STAMP:594dbd4e700334431fccd0dc7bd7ef22ca033299d24ba92f920601a807291c64 +// SHA256STAMP:d2dbf0b5768a6a6c940a353621f8a0521f49104c99d7f5d350c500587a7d54c4