Each header should only include the other headers it needs to compile; `devtools/reduce-includes.sh */*.h` does this. The C files then need additional includes if they don't compile. And remove the entirely useless wire/onion_wire.h, which only serves to include wire/onion_wiregen.h. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
13 KiB
13 KiB
| 1 | #include <bitcoin/chainparams.h> | ||||
|---|---|---|---|---|---|
| 2 | #include <bitcoin/psbt.h> | ||||
| 3 | #include <bitcoin/signature.h> | ||||
| 4 | #include <common/cryptomsg.h> | ||||
| 5 | #include <common/channel_config.h> | ||||
| 6 | #include <common/channel_id.h> | ||||
| 7 | #include <common/channel_type.h> | ||||
| 8 | #include <common/derive_basepoints.h> | ||||
| 9 | #include <common/features.h> | ||||
| 10 | #include <common/fee_states.h> | ||||
| 11 | #include <common/htlc_wire.h> | ||||
| 12 | #include <common/penalty_base.h> | ||||
| 13 | #include <common/tx_roles.h> | ||||
| 14 | #include <secp256k1.h> | ||||
| 15 | #include <wire/peer_wire.h> | ||||
| 16 | msgtype | dualopend_init | 7000 | ||
| 17 | # Which network are we configured for? | ||||
| 18 | msgdata | dualopend_init | chainparams | chainparams | |
| 19 | msgdata | dualopend_init | our_feature_set | feature_set | |
| 20 | msgdata | dualopend_init | their_init_features_len | u16 | |
| 21 | msgdata | dualopend_init | their_init_features | u8 | their_init_features_len |
| 22 | # Base configuration we'll offer | ||||
| 23 | msgdata | dualopend_init | our_config | channel_config | |
| 24 | # Minimum/maximum configuration values we'll accept | ||||
| 25 | msgdata | dualopend_init | max_to_self_delay | u32 | |
| 26 | msgdata | dualopend_init | min_effective_htlc_capacity_msat | amount_msat | |
| 27 | msgdata | dualopend_init | our_basepoints | basepoints | |
| 28 | msgdata | dualopend_init | our_funding_pubkey | pubkey | |
| 29 | # Constraints in case the other end tries to open a channel. | ||||
| 30 | msgdata | dualopend_init | minimum_depth | u32 | |
| 31 | msgdata | dualopend_init | require_confirmed_inputs | bool | |
| 32 | msgdata | dualopend_init | local_alias | short_channel_id | |
| 33 | msgdata | dualopend_init | dev_accept_any_channel_type | bool | |
| 34 | # master-dualopend: peer has reconnected | ||||
| 35 | msgtype | dualopend_reinit | 7001 | ||
| 36 | msgdata | dualopend_reinit | chainparams | chainparams | |
| 37 | msgdata | dualopend_reinit | from_abort | bool | |
| 38 | msgdata | dualopend_reinit | our_feature_set | feature_set | |
| 39 | msgdata | dualopend_reinit | their_init_features_len | u16 | |
| 40 | msgdata | dualopend_reinit | their_init_features | u8 | their_init_features_len |
| 41 | msgdata | dualopend_reinit | our_config | channel_config | |
| 42 | msgdata | dualopend_reinit | their_config | channel_config | |
| 43 | msgdata | dualopend_reinit | channel_id | channel_id | |
| 44 | msgdata | dualopend_reinit | max_to_self_delay | u32 | |
| 45 | msgdata | dualopend_reinit | min_effective_htlc_capacity_msat | amount_msat | |
| 46 | msgdata | dualopend_reinit | our_basepoints | basepoints | |
| 47 | msgdata | dualopend_reinit | our_funding_pubkey | pubkey | |
| 48 | msgdata | dualopend_reinit | their_funding_pubkey | pubkey | |
| 49 | msgdata | dualopend_reinit | minimum_depth | u32 | |
| 50 | msgdata | dualopend_reinit | funding | bitcoin_outpoint | |
| 51 | msgdata | dualopend_reinit | most_recent_feerate_per_kw_funding | u32 | |
| 52 | msgdata | dualopend_reinit | funding_satoshi | amount_sat | |
| 53 | msgdata | dualopend_reinit | our_funding | amount_msat | |
| 54 | msgdata | dualopend_reinit | their_basepoints | basepoints | |
| 55 | msgdata | dualopend_reinit | remote_per_commit | pubkey | |
| 56 | msgdata | dualopend_reinit | funding_psbt | wally_psbt | |
| 57 | msgdata | dualopend_reinit | opener | enum side | |
| 58 | msgdata | dualopend_reinit | local_channel_ready | bool | |
| 59 | msgdata | dualopend_reinit | remote_channel_ready | bool | |
| 60 | msgdata | dualopend_reinit | send_shutdown | bool | |
| 61 | msgdata | dualopend_reinit | remote_shutdown_received | bool | |
| 62 | msgdata | dualopend_reinit | local_shutdown_len | u16 | |
| 63 | msgdata | dualopend_reinit | local_shutdown_scriptpubkey | u8 | local_shutdown_len |
| 64 | msgdata | dualopend_reinit | remote_shutdown_len | u16 | |
| 65 | msgdata | dualopend_reinit | remote_shutdown_scriptpubkey | u8 | remote_shutdown_len |
| 66 | msgdata | dualopend_reinit | local_shutdown_wallet_index | ?u32 | |
| 67 | msgdata | dualopend_reinit | remote_funding_sigs_received | bool | |
| 68 | msgdata | dualopend_reinit | remote_commit_received | bool | |
| 69 | msgdata | dualopend_reinit | fee_states | fee_states | |
| 70 | msgdata | dualopend_reinit | channel_flags | u8 | |
| 71 | msgdata | dualopend_reinit | lease_start_blockheight | u32 | |
| 72 | msgdata | dualopend_reinit | lease_expiry | u32 | |
| 73 | msgdata | dualopend_reinit | lease_commit_sig | ?secp256k1_ecdsa_signature | |
| 74 | msgdata | dualopend_reinit | lease_chan_max_msat | u32 | |
| 75 | msgdata | dualopend_reinit | lease_chan_max_ppt | u16 | |
| 76 | msgdata | dualopend_reinit | requested_lease | ?amount_sat | |
| 77 | msgdata | dualopend_reinit | channel_type | channel_type | |
| 78 | msgdata | dualopend_reinit | we_require_confirmed_inputs | bool | |
| 79 | msgdata | dualopend_reinit | they_require_confirmed_inputs | bool | |
| 80 | msgdata | dualopend_reinit | local_alias | short_channel_id | |
| 81 | # dualopend->master: they offered channel | should we continue? | |||
| 82 | msgtype | dualopend_got_offer | 7005 | ||
| 83 | msgdata | dualopend_got_offer | channel_id | channel_id | |
| 84 | msgdata | dualopend_got_offer | opener_funding | amount_sat | |
| 85 | msgdata | dualopend_got_offer | dust_limit_satoshis | amount_sat | |
| 86 | msgdata | dualopend_got_offer | max_htlc_value_in_flight_msat | amount_msat | |
| 87 | msgdata | dualopend_got_offer | htlc_minimum_msat | amount_msat | |
| 88 | msgdata | dualopend_got_offer | feerate_per_kw_funding | u32 | |
| 89 | msgdata | dualopend_got_offer | feerate_per_kw_commitment | u32 | |
| 90 | msgdata | dualopend_got_offer | to_self_delay | u16 | |
| 91 | msgdata | dualopend_got_offer | max_accepted_htlcs | u16 | |
| 92 | msgdata | dualopend_got_offer | channel_flags | u8 | |
| 93 | msgdata | dualopend_got_offer | locktime | u32 | |
| 94 | msgdata | dualopend_got_offer | shutdown_len | u16 | |
| 95 | msgdata | dualopend_got_offer | shutdown_scriptpubkey | u8 | shutdown_len |
| 96 | msgdata | dualopend_got_offer | requested_amt | ?amount_sat | |
| 97 | msgdata | dualopend_got_offer | lease_blockheight_start | u32 | |
| 98 | msgdata | dualopend_got_offer | require_confirmed_inputs | bool | |
| 99 | msgdata | dualopend_got_offer | ctype | channel_type | |
| 100 | # master->dualopend: reply back with our first funding info/contribs | ||||
| 101 | msgtype | dualopend_got_offer_reply | 7105 | ||
| 102 | msgdata | dualopend_got_offer_reply | accepter_funding | amount_sat | |
| 103 | msgdata | dualopend_got_offer_reply | psbt | wally_psbt | |
| 104 | msgdata | dualopend_got_offer_reply | shutdown_len | u16 | |
| 105 | msgdata | dualopend_got_offer_reply | our_shutdown_scriptpubkey | ?u8 | shutdown_len |
| 106 | msgdata | dualopend_got_offer_reply | our_shutdown_wallet_index | ?u32 | |
| 107 | # must go last because of embedded tu32 | ||||
| 108 | msgdata | dualopend_got_offer_reply | lease_rates | ?lease_rates | |
| 109 | # dualopend->master: they offered a RBF | should we continue? | |||
| 110 | msgtype | dualopend_got_rbf_offer | 7500 | ||
| 111 | msgdata | dualopend_got_rbf_offer | channel_id | channel_id | |
| 112 | msgdata | dualopend_got_rbf_offer | their_last_funding | amount_sat | |
| 113 | msgdata | dualopend_got_rbf_offer | their_curr_funding | amount_sat | |
| 114 | msgdata | dualopend_got_rbf_offer | our_last_funding | amount_sat | |
| 115 | msgdata | dualopend_got_rbf_offer | funding_feerate_per_kw | u32 | |
| 116 | msgdata | dualopend_got_rbf_offer | locktime | u32 | |
| 117 | msgdata | dualopend_got_rbf_offer | requested_lease | ?amount_sat | |
| 118 | msgdata | dualopend_got_rbf_offer | require_confirmed_inputs | bool | |
| 119 | # master->dualopend: reply back with our funding info/contribs | ||||
| 120 | msgtype | dualopend_got_rbf_offer_reply | 7505 | ||
| 121 | msgdata | dualopend_got_rbf_offer_reply | our_funding | amount_sat | |
| 122 | msgdata | dualopend_got_rbf_offer_reply | psbt | wally_psbt | |
| 123 | # dualopend->master: update to require_confirmed_inputs preference | ||||
| 124 | msgtype | dualopend_update_require_confirmed | 7511 | ||
| 125 | msgdata | dualopend_update_require_confirmed | require_confirmed_inputs | bool | |
| 126 | # dualopend->master: is this a valid RBF candidate transaction? | ||||
| 127 | msgtype | dualopend_rbf_validate | 7506 | ||
| 128 | msgdata | dualopend_rbf_validate | proposed_funding_psbt | wally_psbt | |
| 129 | # master->dualopend: this is a valid RBF candidate transaction | ||||
| 130 | msgtype | dualopend_rbf_valid | 7507 | ||
| 131 | # master->dualopend: attempt an RBF | ||||
| 132 | msgtype | dualopend_rbf_init | 7509 | ||
| 133 | msgdata | dualopend_rbf_init | our_funding | amount_sat | |
| 134 | msgdata | dualopend_rbf_init | funding_feerate_perkw | u32 | |
| 135 | msgdata | dualopend_rbf_init | psbt | wally_psbt | |
| 136 | # dualopend->master: about to send first commitment_signed | ||||
| 137 | msgtype | dualopend_commit_ready | 7009 | ||
| 138 | msgdata | dualopend_commit_ready | their_config | channel_config | |
| 139 | msgdata | dualopend_commit_ready | psbt | wally_psbt | |
| 140 | msgdata | dualopend_commit_ready | revocation_basepoint | pubkey | |
| 141 | msgdata | dualopend_commit_ready | payment_basepoint | pubkey | |
| 142 | msgdata | dualopend_commit_ready | htlc_basepoint | pubkey | |
| 143 | msgdata | dualopend_commit_ready | delayed_payment_basepoint | pubkey | |
| 144 | msgdata | dualopend_commit_ready | their_per_commit_point | pubkey | |
| 145 | msgdata | dualopend_commit_ready | remote_fundingkey | pubkey | |
| 146 | msgdata | dualopend_commit_ready | funding | bitcoin_outpoint | |
| 147 | msgdata | dualopend_commit_ready | funding_satoshis | amount_sat | |
| 148 | msgdata | dualopend_commit_ready | our_funding_sats | amount_sat | |
| 149 | msgdata | dualopend_commit_ready | channel_flags | u8 | |
| 150 | msgdata | dualopend_commit_ready | feerate_per_kw_funding | u32 | |
| 151 | msgdata | dualopend_commit_ready | feerate_per_kw_commitment | u32 | |
| 152 | msgdata | dualopend_commit_ready | local_shutdown_len | u16 | |
| 153 | msgdata | dualopend_commit_ready | local_shutdown_scriptpubkey | u8 | local_shutdown_len |
| 154 | msgdata | dualopend_commit_ready | remote_shutdown_len | u16 | |
| 155 | msgdata | dualopend_commit_ready | remote_shutdown_scriptpubkey | u8 | remote_shutdown_len |
| 156 | msgdata | dualopend_commit_ready | lease_amt | amount_sat | |
| 157 | msgdata | dualopend_commit_ready | lease_start_blockheight | u32 | |
| 158 | msgdata | dualopend_commit_ready | lease_expiry | u32 | |
| 159 | msgdata | dualopend_commit_ready | lease_fee | amount_sat | |
| 160 | msgdata | dualopend_commit_ready | lease_commit_sig | ?secp256k1_ecdsa_signature | |
| 161 | msgdata | dualopend_commit_ready | lease_chan_max_msat | u32 | |
| 162 | msgdata | dualopend_commit_ready | lease_chan_max_ppt | u16 | |
| 163 | msgdata | dualopend_commit_ready | channel_type | channel_type | |
| 164 | # master->dualopend: channel saved to disk | ||||
| 165 | msgtype | dualopend_commit_send_ack | 7109 | ||
| 166 | # dualopend->master: received commitment signed from peer | ||||
| 167 | # get some signatures for the funding_tx. | ||||
| 168 | msgtype | dualopend_commit_rcvd | 7007 | ||
| 169 | msgdata | dualopend_commit_rcvd | remote_first_commit | bitcoin_tx | |
| 170 | msgdata | dualopend_commit_rcvd | first_commit_sig | bitcoin_signature | |
| 171 | msgdata | dualopend_commit_rcvd | pbase | ?penalty_base | |
| 172 | # dualopend->master: peer updated the psbt | ||||
| 173 | msgtype | dualopend_psbt_changed | 7107 | ||
| 174 | msgdata | dualopend_psbt_changed | channel_id | channel_id | |
| 175 | msgdata | dualopend_psbt_changed | requires_confirmed_inputs | bool | |
| 176 | msgdata | dualopend_psbt_changed | funding_serial | u64 | |
| 177 | msgdata | dualopend_psbt_changed | psbt | wally_psbt | |
| 178 | msgdata | dualopend_psbt_changed | channel_type | channel_type | |
| 179 | # master->dualopend: we updated the psbt | ||||
| 180 | msgtype | dualopend_psbt_updated | 7108 | ||
| 181 | msgdata | dualopend_psbt_updated | psbt | wally_psbt | |
| 182 | # master->dualopend: fail this channel open | ||||
| 183 | msgtype | dualopend_fail | 7003 | ||
| 184 | msgdata | dualopend_fail | reason | wirestring | |
| 185 | # master->dualopend: hello | I'd like to start a channel open | |||
| 186 | msgtype | dualopend_opener_init | 7200 | ||
| 187 | msgdata | dualopend_opener_init | psbt | wally_psbt | |
| 188 | msgdata | dualopend_opener_init | funding_amount | amount_sat | |
| 189 | msgdata | dualopend_opener_init | local_shutdown_len | u16 | |
| 190 | msgdata | dualopend_opener_init | local_shutdown_scriptpubkey | u8 | local_shutdown_len |
| 191 | msgdata | dualopend_opener_init | local_shutdown_wallet_index | ?u32 | |
| 192 | msgdata | dualopend_opener_init | feerate_per_kw | u32 | |
| 193 | msgdata | dualopend_opener_init | anchor_feerate_per_kw | u32 | |
| 194 | msgdata | dualopend_opener_init | feerate_per_kw_funding | u32 | |
| 195 | msgdata | dualopend_opener_init | channel_flags | u8 | |
| 196 | msgdata | dualopend_opener_init | requested_sats | ?amount_sat | |
| 197 | msgdata | dualopend_opener_init | blockheight | u32 | |
| 198 | msgdata | dualopend_opener_init | dry_run | bool | |
| 199 | msgdata | dualopend_opener_init | channel_type | channel_type | |
| 200 | # must go last because embedded tu32 | ||||
| 201 | msgdata | dualopend_opener_init | expected_rates | ?lease_rates | |
| 202 | # dualopend->master received tx_sigs from peer | ||||
| 203 | msgtype | dualopend_funding_sigs | 7010 | ||
| 204 | msgdata | dualopend_funding_sigs | signed_psbt | wally_psbt | |
| 205 | # master->dualopend send our tx_sigs to peer | ||||
| 206 | msgtype | dualopend_send_tx_sigs | 7011 | ||
| 207 | msgdata | dualopend_send_tx_sigs | signed_psbt | wally_psbt | |
| 208 | # dualopend->master tx sigs transmitted to peer | ||||
| 209 | msgtype | dualopend_tx_sigs_sent | 7012 | ||
| 210 | # dualopend->peer peer locked channel | ||||
| 211 | msgtype | dualopend_peer_locked | 7018 | ||
| 212 | msgdata | dualopend_peer_locked | remote_per_commit | pubkey | |
| 213 | msgdata | dualopend_peer_locked | remote_alias | ?short_channel_id | |
| 214 | # dualopend->master this channel has been locked | ||||
| 215 | msgtype | dualopend_channel_locked | 7019 | ||
| 216 | # master->dualopend funding reached depth; tell peer | ||||
| 217 | msgtype | dualopend_depth_reached | 7020 | ||
| 218 | msgdata | dualopend_depth_reached | depth | u32 | |
| 219 | # Tell peer to shut down channel. | ||||
| 220 | msgtype | dualopend_send_shutdown | 7023 | ||
| 221 | msgdata | dualopend_send_shutdown | shutdown_scriptpubkey_len | u16 | |
| 222 | msgdata | dualopend_send_shutdown | shutdown_scriptpubkey | u8 | shutdown_scriptpubkey_len |
| 223 | # Peer told us that channel is shutting down | ||||
| 224 | msgtype | dualopend_got_shutdown | 7024 | ||
| 225 | msgdata | dualopend_got_shutdown | scriptpubkey_len | u16 | |
| 226 | msgdata | dualopend_got_shutdown | scriptpubkey | u8 | scriptpubkey_len |
| 227 | # Peer presented proof it was from the future. | ||||
| 228 | msgtype | dualopend_fail_fallen_behind | 1028 | ||
| 229 | # Shutdown is complete | ready for closing negotiation. + peer_fd & gossip_fd. | |||
| 230 | msgtype | dualopend_shutdown_complete | 7025 | ||
| 231 | # master -> dualopend: do you have a memleak? | ||||
| 232 | msgtype | dualopend_dev_memleak | 7033 | ||
| 233 | msgtype | dualopend_dev_memleak_reply | 7133 | ||
| 234 | msgdata | dualopend_dev_memleak_reply | leak | bool | |
| 235 | # dualopend -> master: this was a dry run | here's some info about this open | |||
| 236 | msgtype | dualopend_dry_run | 7026 | ||
| 237 | msgdata | dualopend_dry_run | channel_id | channel_id | |
| 238 | msgdata | dualopend_dry_run | our_funding | amount_sat | |
| 239 | msgdata | dualopend_dry_run | their_funding | amount_sat | |
| 240 | msgdata | dualopend_dry_run | requires_confirmed_inputs | bool | |
| 241 | # must go last because of embedded tu32 | ||||
| 242 | msgdata | dualopend_dry_run | lease_rates | ?lease_rates | |
| 243 | # dualopend -> master: are inputs in this psbt confirmed? | ||||
| 244 | msgtype | dualopend_validate_inputs | 7029 | ||
| 245 | msgdata | dualopend_validate_inputs | psbt | wally_psbt | |
| 246 | msgdata | dualopend_validate_inputs | side | enum tx_role | |
| 247 | # master -> dualopend: confirms inputs are valid | ||||
| 248 | msgtype | dualopend_validate_inputs_reply | 7030 | ||
| 249 | # dualopend -> master: validate liqudity offer sig | ||||
| 250 | msgtype | dualopend_validate_lease | 7027 | ||
| 251 | msgdata | dualopend_validate_lease | sig | secp256k1_ecdsa_signature | |
| 252 | msgdata | dualopend_validate_lease | lease_expiry | u32 | |
| 253 | msgdata | dualopend_validate_lease | chan_fee_max_base_msat | u32 | |
| 254 | msgdata | dualopend_validate_lease | chan_fee_max_ppt | u16 | |
| 255 | msgdata | dualopend_validate_lease | their_pubkey | pubkey | |
| 256 | msgtype | dualopend_validate_lease_reply | 7127 | ||
| 257 | msgdata | dualopend_validate_lease_reply | err_msg | ?wirestring | |
| 258 | msgtype | dualopend_got_announcement | 7031 | ||
| 259 | msgdata | dualopend_got_announcement | scid | short_channel_id | |
| 260 | msgdata | dualopend_got_announcement | remote_ann_node_sig | secp256k1_ecdsa_signature | |
| 261 | msgdata | dualopend_got_announcement | remote_ann_bitcoin_sig | secp256k1_ecdsa_signature |