diff --git a/Makefile b/Makefile index 2892c7454..5f824426c 100644 --- a/Makefile +++ b/Makefile @@ -247,6 +247,13 @@ config.vars: %.o: %.c @$(call VERBOSE, "cc $<", $(CC) $(CFLAGS) -c -o $@ $<) +# generate-wire.py --page [header|impl] hdrfilename wirename < csv > file +%_wiregen.h: %_wire.csv + @if $(CHANGED_FROM_GIT); then $(call VERBOSE,"wiregen $@",tools/generate-wire.py --page header $($@_args) $@ `basename $< .csv` < $< > $@); fi + +%_wiregen.c: %_wire.csv + @if $(CHANGED_FROM_GIT); then $(call VERBOSE,"wiregen $@",tools/generate-wire.py --page impl $($@_args) ${@:.c=.h} `basename $< .csv` < $< > $@); fi + include external/Makefile include bitcoin/Makefile include common/Makefile diff --git a/channeld/Makefile b/channeld/Makefile index e9cc0dc11..6e2bb913d 100644 --- a/channeld/Makefile +++ b/channeld/Makefile @@ -10,7 +10,7 @@ channeld-all: lightningd/lightning_channeld LIGHTNINGD_CHANNEL_HEADERS_GEN := \ channeld/gen_full_channel_error_names.h \ - channeld/gen_channel_wire.h + channeld/channeld_wiregen.h LIGHTNINGD_CHANNEL_HEADERS_NOGEN := \ channeld/channeld_htlc.h \ @@ -24,7 +24,7 @@ LIGHTNINGD_CHANNEL_HEADERS := $(LIGHTNINGD_CHANNEL_HEADERS_GEN) $(LIGHTNINGD_CHA LIGHTNINGD_CHANNEL_SRC := channeld/channeld.c \ channeld/commit_tx.c \ channeld/full_channel.c \ - channeld/gen_channel_wire.c \ + channeld/channeld_wiregen.c \ channeld/watchtower.c LIGHTNINGD_CHANNEL_OBJS := $(LIGHTNINGD_CHANNEL_SRC:.c=.o) @@ -97,9 +97,9 @@ CHANNELD_COMMON_OBJS := \ wire/fromwire.o \ wire/towire.o -LIGHTNINGD_CHANNEL_SRC_GEN := $(filter channeld/gen_%, $(LIGHTNINGD_CHANNEL_SRC)) +LIGHTNINGD_CHANNEL_SRC_GEN := $(filter channeld/%_wiregen.c, $(LIGHTNINGD_CHANNEL_SRC)) -LIGHTNINGD_CHANNEL_SRC_NOGEN := $(filter-out channeld/gen_%, $(LIGHTNINGD_CHANNEL_SRC)) +LIGHTNINGD_CHANNEL_SRC_NOGEN := $(filter-out channeld/%_wiregen.c, $(LIGHTNINGD_CHANNEL_SRC)) # Control daemon uses this: LIGHTNINGD_CHANNEL_CONTROL_HEADERS := $(LIGHTNINGD_CHANNEL_HEADERS_GEN) @@ -116,12 +116,6 @@ channeld/gen_full_channel_error_names.h: channeld/full_channel_error.h ccan/ccan $(LIGHTNINGD_CHANNEL_OBJS): $(LIGHTNINGD_HEADERS) $(LIGHTNINGD_GOSSIP_CONTROL_HEADERS) -channeld/gen_channel_wire.h: $(WIRE_GEN) channeld/channel_wire.csv - $(WIRE_GEN) --page header $@ channel_wire_type < channeld/channel_wire.csv > $@ - -channeld/gen_channel_wire.c: $(WIRE_GEN) channeld/channel_wire.csv - $(WIRE_GEN) --page impl ${@:.c=.h} channel_wire_type < channeld/channel_wire.csv > $@ - LIGHTNINGD_CHANNEL_OBJS := $(LIGHTNINGD_CHANNEL_SRC:.c=.o) lightningd/lightning_channeld: $(LIGHTNINGD_CHANNEL_OBJS) $(WIRE_ONION_OBJS) $(CHANNELD_COMMON_OBJS) $(WIRE_OBJS) $(BITCOIN_OBJS) $(LIGHTNINGD_HSM_CLIENT_OBJS) diff --git a/channeld/channel_wire.csv b/channeld/channel_wire.csv deleted file mode 100644 index e36dd67b7..000000000 --- a/channeld/channel_wire.csv +++ /dev/null @@ -1,230 +0,0 @@ -#include -#include -#include -#include -#include -#include - -# Begin! (passes gossipd-client fd) -msgtype,channel_init,1000 -msgdata,channel_init,chainparams,chainparams, -msgdata,channel_init,our_features,feature_set, -msgdata,channel_init,funding_txid,bitcoin_txid, -msgdata,channel_init,funding_txout,u16, -msgdata,channel_init,funding_satoshi,amount_sat, -msgdata,channel_init,minimum_depth,u32, -msgdata,channel_init,our_config,channel_config, -msgdata,channel_init,their_config,channel_config, -msgdata,channel_init,fee_states,fee_states, -msgdata,channel_init,feerate_min,u32, -msgdata,channel_init,feerate_max,u32, -msgdata,channel_init,feerate_penalty,u32, -msgdata,channel_init,first_commit_sig,bitcoin_signature, -msgdata,channel_init,per_peer_state,per_peer_state, -msgdata,channel_init,remote_fundingkey,pubkey, -msgdata,channel_init,remote_basepoints,basepoints, -msgdata,channel_init,remote_per_commit,pubkey, -msgdata,channel_init,old_remote_per_commit,pubkey, -msgdata,channel_init,opener,enum side, -msgdata,channel_init,fee_base,u32, -msgdata,channel_init,fee_proportional,u32, -msgdata,channel_init,local_msatoshi,amount_msat, -msgdata,channel_init,our_basepoints,basepoints, -msgdata,channel_init,our_funding_pubkey,pubkey, -msgdata,channel_init,local_node_id,node_id, -msgdata,channel_init,remote_node_id,node_id, -msgdata,channel_init,commit_msec,u32, -msgdata,channel_init,cltv_delta,u16, -msgdata,channel_init,last_was_revoke,bool, -msgdata,channel_init,num_last_sent_commit,u16, -msgdata,channel_init,last_sent_commit,changed_htlc,num_last_sent_commit -msgdata,channel_init,next_index_local,u64, -msgdata,channel_init,next_index_remote,u64, -msgdata,channel_init,revocations_received,u64, -msgdata,channel_init,next_htlc_id,u64, -msgdata,channel_init,num_existing_htlcs,u16, -msgdata,channel_init,htlcs,existing_htlc,num_existing_htlcs -msgdata,channel_init,local_funding_locked,bool, -msgdata,channel_init,remote_funding_locked,bool, -msgdata,channel_init,funding_short_id,short_channel_id, -msgdata,channel_init,reestablish,bool, -msgdata,channel_init,send_shutdown,bool, -msgdata,channel_init,remote_shutdown_received,bool, -msgdata,channel_init,final_scriptpubkey_len,u16, -msgdata,channel_init,final_scriptpubkey,u8,final_scriptpubkey_len -msgdata,channel_init,flags,u8, -msgdata,channel_init,init_peer_pkt_len,u16, -msgdata,channel_init,init_peer_pkt,u8,init_peer_pkt_len -msgdata,channel_init,reached_announce_depth,bool, -msgdata,channel_init,last_remote_secret,secret, -msgdata,channel_init,flen,u16, -msgdata,channel_init,their_features,u8,flen -msgdata,channel_init,upfront_shutdown_script_len,u16, -msgdata,channel_init,upfront_shutdown_script,u8,upfront_shutdown_script_len -msgdata,channel_init,remote_ann_node_sig,?secp256k1_ecdsa_signature, -msgdata,channel_init,remote_ann_bitcoin_sig,?secp256k1_ecdsa_signature, -msgdata,channel_init,option_static_remotekey,bool, -msgdata,channel_init,option_anchor_outputs,bool, -msgdata,channel_init,dev_fast_gossip,bool, -msgdata,channel_init,dev_fail_process_onionpacket,bool, -msgdata,channel_init,num_penalty_bases,u32, -msgdata,channel_init,pbases,penalty_base,num_penalty_bases - -# master->channeld funding hit new depth(funding locked if >= lock depth) -msgtype,channel_funding_depth,1002 -msgdata,channel_funding_depth,short_channel_id,?short_channel_id, -msgdata,channel_funding_depth,depth,u32, - -# Tell channel to offer this htlc -msgtype,channel_offer_htlc,1004 -msgdata,channel_offer_htlc,amount_msat,amount_msat, -msgdata,channel_offer_htlc,cltv_expiry,u32, -msgdata,channel_offer_htlc,payment_hash,sha256, -msgdata,channel_offer_htlc,onion_routing_packet,u8,1366 -msgdata,channel_offer_htlc,blinding,?pubkey, - -# Reply; synchronous since IDs have to increment. -msgtype,channel_offer_htlc_reply,1104 -msgdata,channel_offer_htlc_reply,id,u64, -# Empty failure message means success. -msgdata,channel_offer_htlc_reply,len,u16, -msgdata,channel_offer_htlc_reply,failuremsg,u8,len -msgdata,channel_offer_htlc_reply,failurestr,wirestring, - -# Main daemon found out the preimage for an HTLC -#include -msgtype,channel_fulfill_htlc,1005 -msgdata,channel_fulfill_htlc,fulfilled_htlc,fulfilled_htlc, - -# Main daemon says HTLC failed -msgtype,channel_fail_htlc,1006 -msgdata,channel_fail_htlc,failed_htlc,failed_htlc, - -# When we receive funding_locked. -msgtype,channel_got_funding_locked,1019 -msgdata,channel_got_funding_locked,next_per_commit_point,pubkey, - -#include - -# When we send a commitment_signed message, tell master. -msgtype,channel_sending_commitsig,1020 -msgdata,channel_sending_commitsig,commitnum,u64, -msgdata,channel_sending_commitsig,pbase,?penalty_base, -msgdata,channel_sending_commitsig,fee_states,fee_states, -# SENT_ADD_COMMIT, SENT_REMOVE_ACK_COMMIT, SENT_ADD_ACK_COMMIT, SENT_REMOVE_COMMIT -msgdata,channel_sending_commitsig,num_changed,u16, -msgdata,channel_sending_commitsig,changed,changed_htlc,num_changed -msgdata,channel_sending_commitsig,commit_sig,bitcoin_signature, -msgdata,channel_sending_commitsig,num_htlc_sigs,u16, -msgdata,channel_sending_commitsig,htlc_sigs,bitcoin_signature,num_htlc_sigs - -# Wait for reply, to make sure it's on disk before we send commit. -msgtype,channel_sending_commitsig_reply,1120 - -# When we have a commitment_signed message, tell master to remember. -msgtype,channel_got_commitsig,1021 -msgdata,channel_got_commitsig,commitnum,u64, -msgdata,channel_got_commitsig,fee_states,fee_states, -msgdata,channel_got_commitsig,signature,bitcoin_signature, -msgdata,channel_got_commitsig,num_htlcs,u16, -msgdata,channel_got_commitsig,htlc_signature,bitcoin_signature,num_htlcs -# RCVD_ADD_COMMIT: we're now committed to their new offered HTLCs. -msgdata,channel_got_commitsig,num_added,u16, -msgdata,channel_got_commitsig,added,added_htlc,num_added -# RCVD_REMOVE_COMMIT: we're now no longer committed to these HTLCs. -msgdata,channel_got_commitsig,num_fulfilled,u16, -msgdata,channel_got_commitsig,fulfilled,fulfilled_htlc,num_fulfilled -msgdata,channel_got_commitsig,num_failed,u16, -msgdata,channel_got_commitsig,failed,failed_htlc,num_failed -# RCVD_ADD_ACK_COMMIT, RCVD_REMOVE_ACK_COMMIT -msgdata,channel_got_commitsig,num_changed,u16, -msgdata,channel_got_commitsig,changed,changed_htlc,num_changed -msgdata,channel_got_commitsig,tx,bitcoin_tx, - -# Wait for reply, to make sure it's on disk before we send revocation. -msgtype,channel_got_commitsig_reply,1121 - -#include - -msgtype,channel_got_revoke,1022 -msgdata,channel_got_revoke,revokenum,u64, -msgdata,channel_got_revoke,per_commitment_secret,secret, -msgdata,channel_got_revoke,next_per_commit_point,pubkey, -# RCVD_ADD_ACK_REVOCATION, RCVD_REMOVE_ACK_REVOCATION, RCVD_ADD_REVOCATION, RCVD_REMOVE_REVOCATION -msgdata,channel_got_revoke,fee_states,fee_states, -msgdata,channel_got_revoke,num_changed,u16, -msgdata,channel_got_revoke,changed,changed_htlc,num_changed -msgdata,channel_got_revoke,pbase,?penalty_base, -msgdata,channel_got_revoke,penalty_tx,?bitcoin_tx, -# Wait for reply, to make sure it's on disk before we continue -# (eg. if we sent another commitment_signed, that would implicitly ack). -msgtype,channel_got_revoke_reply,1122 - -# Tell peer to shut down channel. -msgtype,channel_send_shutdown,1023 -msgdata,channel_send_shutdown,shutdown_len,u16, -msgdata,channel_send_shutdown,shutdown_scriptpubkey,u8,shutdown_len - -# Peer told us that channel is shutting down -msgtype,channel_got_shutdown,1024 -msgdata,channel_got_shutdown,scriptpubkey_len,u16, -msgdata,channel_got_shutdown,scriptpubkey,u8,scriptpubkey_len - -# Shutdown is complete, ready for closing negotiation. + peer_fd & gossip_fd. -msgtype,channel_shutdown_complete,1025 -msgdata,channel_shutdown_complete,per_peer_state,per_peer_state, - -# Re-enable commit timer. -msgtype,channel_dev_reenable_commit,1026 -msgtype,channel_dev_reenable_commit_reply,1126, - -msgtype,channel_feerates,1027 -msgdata,channel_feerates,feerate,u32, -msgdata,channel_feerates,min_feerate,u32, -msgdata,channel_feerates,max_feerate,u32, -msgdata,channel_feerates,penalty_feerate,u32, - -# master -> channeld: do you have a memleak? -msgtype,channel_dev_memleak,1033 - -msgtype,channel_dev_memleak_reply,1133 -msgdata,channel_dev_memleak_reply,leak,bool, - -# Peer presented proof it was from the future. -msgtype,channel_fail_fallen_behind,1028 -# This is NULL if option_static_remotekey. -msgdata,channel_fail_fallen_behind,remote_per_commitment_point,?pubkey, - -# Handle a channel specific feerate base ppm configuration -msgtype,channel_specific_feerates,1029 -msgdata,channel_specific_feerates,feerate_base,u32, -msgdata,channel_specific_feerates,feerate_ppm,u32, - -# When we receive announcement_signatures for channel announce -msgtype,channel_got_announcement,1017 -msgdata,channel_got_announcement,remote_ann_node_sig,secp256k1_ecdsa_signature, -msgdata,channel_got_announcement,remote_ann_bitcoin_sig,secp256k1_ecdsa_signature, - -# Ask channeld to send a error message. Used in forgetting channel case. -msgtype,channel_send_error,1008 -msgdata,channel_send_error,reason,wirestring, - -# Tell master channeld has sent the error message. -msgtype,channel_send_error_reply,1108 - -# Tell lightningd we got a onion message (for us, or to fwd) -msgtype,got_onionmsg_to_us,1142 -msgdata,got_onionmsg_to_us,reply_blinding,?pubkey, -msgdata,got_onionmsg_to_us,reply_path_len,u16, -msgdata,got_onionmsg_to_us,reply_path,onionmsg_path,reply_path_len - -msgtype,got_onionmsg_forward,1143 -msgdata,got_onionmsg_forward,next_scid,?short_channel_id, -msgdata,got_onionmsg_forward,next_node_id,?node_id, -msgdata,got_onionmsg_forward,next_blinding,?pubkey, -msgdata,got_onionmsg_forward,next_onion,u8,1366 - -# Lightningd tells us to send a onion message. -msgtype,send_onionmsg,1040 -msgdata,send_onionmsg,onion,u8,1366 -msgdata,send_onionmsg,blinding,?pubkey, diff --git a/channeld/channeld.c b/channeld/channeld.c index 1a34b90c0..28317f360 100644 --- a/channeld/channeld.c +++ b/channeld/channeld.c @@ -25,9 +25,9 @@ #include #include #include +#include #include #include -#include #include #include #include @@ -541,7 +541,7 @@ static void channel_announcement_negotiate(struct peer *peer) /* After making sure short_channel_ids match, we can send remote * announcement to MASTER. */ wire_sync_write(MASTER_FD, - take(towire_channel_got_announcement(NULL, + take(towire_channeld_got_announcement(NULL, &peer->announcement_node_sigs[REMOTE], &peer->announcement_bitcoin_sigs[REMOTE]))); @@ -587,7 +587,7 @@ static void handle_peer_funding_locked(struct peer *peer, const u8 *msg) peer->funding_locked[REMOTE] = true; wire_sync_write(MASTER_FD, - take(towire_channel_got_funding_locked(NULL, + take(towire_channeld_got_funding_locked(NULL, &peer->remote_per_commit))); channel_announcement_negotiate(peer); @@ -746,7 +746,7 @@ static u8 *sending_commitsig_msg(const tal_t *ctx, /* We tell master what (of our) HTLCs peer will now be * committed to. */ changed = changed_htlc_arr(tmpctx, changed_htlcs); - msg = towire_channel_sending_commitsig(ctx, remote_commit_index, pbase, fee_states, changed, + msg = towire_channeld_sending_commitsig(ctx, remote_commit_index, pbase, fee_states, changed, commit_sig, htlc_sigs); return msg; } @@ -1092,7 +1092,7 @@ static void send_commit(struct peer *peer) htlc_sigs); /* Message is empty; receiving it is the point. */ master_wait_sync_reply(tmpctx, peer, take(msg), - WIRE_CHANNEL_SENDING_COMMITSIG_REPLY); + WIRE_CHANNELD_SENDING_COMMITSIG_REPLY); status_debug("Sending commit_sig with %zu htlc sigs", tal_count(htlc_sigs)); @@ -1258,7 +1258,7 @@ static void send_revocation(struct peer *peer, /* We had to do this after channel_sending_revoke_and_ack, since we * want it to save the fee_states produced there. */ msg_for_master - = towire_channel_got_commitsig(NULL, + = towire_channeld_got_commitsig(NULL, peer->next_index[LOCAL] - 1, peer->channel->fee_states, commit_sig, htlc_sigs, @@ -1268,7 +1268,7 @@ static void send_revocation(struct peer *peer, changed, committx); master_wait_sync_reply(tmpctx, peer, take(msg_for_master), - WIRE_CHANNEL_GOT_COMMITSIG_REPLY); + WIRE_CHANNELD_GOT_COMMITSIG_REPLY); /* Now we can finally send revoke_and_ack to peer */ sync_crypto_write_no_delay(peer->pps, take(msg)); @@ -1465,7 +1465,7 @@ static u8 *got_revoke_msg(struct peer *peer, u64 revoke_num, HSM_FD); } - msg = towire_channel_got_revoke(peer, revoke_num, per_commitment_secret, + msg = towire_channeld_got_revoke(peer, revoke_num, per_commitment_secret, next_per_commit_point, fee_states, changed, pbase, ptx); tal_free(ptx); @@ -1530,7 +1530,7 @@ static void handle_peer_revoke_and_ack(struct peer *peer, const u8 *msg) changed_htlcs, peer->channel->fee_states); master_wait_sync_reply(tmpctx, peer, take(msg), - WIRE_CHANNEL_GOT_REVOKE_REPLY); + WIRE_CHANNELD_GOT_REVOKE_REPLY); peer->old_remote_per_commit = peer->remote_per_commit; peer->remote_per_commit = next_per_commit; @@ -1712,7 +1712,7 @@ static void handle_peer_shutdown(struct peer *peer, const u8 *shutdown) /* Tell master: we don't have to wait because on reconnect other end * will re-send anyway. */ wire_sync_write(MASTER_FD, - take(towire_channel_got_shutdown(NULL, scriptpubkey))); + take(towire_channeld_got_shutdown(NULL, scriptpubkey))); peer->shutdown_sent[REMOTE] = true; /* BOLT #2: @@ -2284,7 +2284,7 @@ static void check_future_dataloss_fields(struct peer *peer, * commitment transaction on-chain. */ wire_sync_write(MASTER_FD, - take(towire_channel_fail_fallen_behind(NULL, + take(towire_channeld_fail_fallen_behind(NULL, remote_current_per_commitment_point))); /* We have to send them an error to trigger dropping to chain. */ @@ -2719,11 +2719,11 @@ static void handle_funding_depth(struct peer *peer, const u8 *msg) u32 depth; struct short_channel_id *scid; - if (!fromwire_channel_funding_depth(tmpctx, + if (!fromwire_channeld_funding_depth(tmpctx, msg, &scid, &depth)) - master_badmsg(WIRE_CHANNEL_FUNDING_DEPTH, msg); + master_badmsg(WIRE_CHANNELD_FUNDING_DEPTH, msg); /* Too late, we're shutting down! */ if (peer->shutdown_sent[LOCAL]) @@ -2779,10 +2779,10 @@ static void handle_offer_htlc(struct peer *peer, const u8 *inmsg) status_failed(STATUS_FAIL_MASTER_IO, "funding not locked for offer_htlc"); - if (!fromwire_channel_offer_htlc(tmpctx, inmsg, &amount, + if (!fromwire_channeld_offer_htlc(tmpctx, inmsg, &amount, &cltv_expiry, &payment_hash, onion_routing_packet, &blinding)) - master_badmsg(WIRE_CHANNEL_OFFER_HTLC, inmsg); + master_badmsg(WIRE_CHANNELD_OFFER_HTLC, inmsg); #if EXPERIMENTAL_FEATURES struct tlv_update_add_tlvs *tlvs; @@ -2816,7 +2816,7 @@ static void handle_offer_htlc(struct peer *peer, const u8 *inmsg) sync_crypto_write(peer->pps, take(msg)); start_commit_timer(peer); /* Tell the master. */ - msg = towire_channel_offer_htlc_reply(NULL, peer->htlc_id, + msg = towire_channeld_offer_htlc_reply(NULL, peer->htlc_id, 0, ""); wire_sync_write(MASTER_FD, take(msg)); peer->htlc_id++; @@ -2855,7 +2855,7 @@ static void handle_offer_htlc(struct peer *peer, const u8 *inmsg) abort(); failed: - msg = towire_channel_offer_htlc_reply(NULL, 0, failwiremsg, failstr); + msg = towire_channeld_offer_htlc_reply(NULL, 0, failwiremsg, failstr); wire_sync_write(MASTER_FD, take(msg)); } @@ -2863,11 +2863,11 @@ static void handle_feerates(struct peer *peer, const u8 *inmsg) { u32 feerate; - if (!fromwire_channel_feerates(inmsg, &feerate, + if (!fromwire_channeld_feerates(inmsg, &feerate, &peer->feerate_min, &peer->feerate_max, &peer->feerate_penalty)) - master_badmsg(WIRE_CHANNEL_FEERATES, inmsg); + master_badmsg(WIRE_CHANNELD_FEERATES, inmsg); /* BOLT #2: * @@ -2900,10 +2900,10 @@ static void handle_specific_feerates(struct peer *peer, const u8 *inmsg) u32 base_old = peer->fee_base; u32 per_satoshi_old = peer->fee_per_satoshi; - if (!fromwire_channel_specific_feerates(inmsg, + if (!fromwire_channeld_specific_feerates(inmsg, &peer->fee_base, &peer->fee_per_satoshi)) - master_badmsg(WIRE_CHANNEL_SPECIFIC_FEERATES, inmsg); + master_badmsg(WIRE_CHANNELD_SPECIFIC_FEERATES, inmsg); /* only send channel updates if values actually changed */ if (peer->fee_base != base_old || peer->fee_per_satoshi != per_satoshi_old) @@ -2916,8 +2916,8 @@ static void handle_preimage(struct peer *peer, const u8 *inmsg) struct fulfilled_htlc fulfilled_htlc; struct htlc *h; - if (!fromwire_channel_fulfill_htlc(inmsg, &fulfilled_htlc)) - master_badmsg(WIRE_CHANNEL_FULFILL_HTLC, inmsg); + if (!fromwire_channeld_fulfill_htlc(inmsg, &fulfilled_htlc)) + master_badmsg(WIRE_CHANNELD_FULFILL_HTLC, inmsg); switch (channel_fulfill_htlc(peer->channel, REMOTE, fulfilled_htlc.id, @@ -2948,8 +2948,8 @@ static void handle_fail(struct peer *peer, const u8 *inmsg) enum channel_remove_err e; struct htlc *h; - if (!fromwire_channel_fail_htlc(inmsg, inmsg, &failed_htlc)) - master_badmsg(WIRE_CHANNEL_FAIL_HTLC, inmsg); + if (!fromwire_channeld_fail_htlc(inmsg, inmsg, &failed_htlc)) + master_badmsg(WIRE_CHANNELD_FAIL_HTLC, inmsg); e = channel_fail_htlc(peer->channel, REMOTE, failed_htlc->id, &h); switch (e) { @@ -2975,8 +2975,8 @@ static void handle_shutdown_cmd(struct peer *peer, const u8 *inmsg) { u8 *local_shutdown_script; - if (!fromwire_channel_send_shutdown(peer, inmsg, &local_shutdown_script)) - master_badmsg(WIRE_CHANNEL_SEND_SHUTDOWN, inmsg); + if (!fromwire_channeld_send_shutdown(peer, inmsg, &local_shutdown_script)) + master_badmsg(WIRE_CHANNELD_SEND_SHUTDOWN, inmsg); tal_free(peer->final_scriptpubkey); peer->final_scriptpubkey = local_shutdown_script; @@ -2989,15 +2989,15 @@ static void handle_shutdown_cmd(struct peer *peer, const u8 *inmsg) static void handle_send_error(struct peer *peer, const u8 *msg) { char *reason; - if (!fromwire_channel_send_error(msg, msg, &reason)) - master_badmsg(WIRE_CHANNEL_SEND_ERROR, msg); + if (!fromwire_channeld_send_error(msg, msg, &reason)) + master_badmsg(WIRE_CHANNELD_SEND_ERROR, msg); status_debug("Send error reason: %s", reason); sync_crypto_write(peer->pps, take(towire_errorfmt(NULL, &peer->channel_id, "%s", reason))); wire_sync_write(MASTER_FD, - take(towire_channel_send_error_reply(NULL))); + take(towire_channeld_send_error_reply(NULL))); } #if DEVELOPER @@ -3007,7 +3007,7 @@ static void handle_dev_reenable_commit(struct peer *peer) start_commit_timer(peer); status_debug("dev_reenable_commit"); wire_sync_write(MASTER_FD, - take(towire_channel_dev_reenable_commit_reply(NULL))); + take(towire_channeld_dev_reenable_commit_reply(NULL))); } static void handle_dev_memleak(struct peer *peer, const u8 *msg) @@ -3022,7 +3022,7 @@ static void handle_dev_memleak(struct peer *peer, const u8 *msg) found_leak = dump_memleak(memtable); wire_sync_write(MASTER_FD, - take(towire_channel_dev_memleak_reply(NULL, + take(towire_channeld_dev_memleak_reply(NULL, found_leak))); } @@ -3037,31 +3037,31 @@ static void channeld_send_custommsg(struct peer *peer, const u8 *msg) static void req_in(struct peer *peer, const u8 *msg) { - enum channel_wire_type t = fromwire_peektype(msg); + enum channeld_wire t = fromwire_peektype(msg); switch (t) { - case WIRE_CHANNEL_FUNDING_DEPTH: + case WIRE_CHANNELD_FUNDING_DEPTH: handle_funding_depth(peer, msg); return; - case WIRE_CHANNEL_OFFER_HTLC: + case WIRE_CHANNELD_OFFER_HTLC: handle_offer_htlc(peer, msg); return; - case WIRE_CHANNEL_FEERATES: + case WIRE_CHANNELD_FEERATES: handle_feerates(peer, msg); return; - case WIRE_CHANNEL_FULFILL_HTLC: + case WIRE_CHANNELD_FULFILL_HTLC: handle_preimage(peer, msg); return; - case WIRE_CHANNEL_FAIL_HTLC: + case WIRE_CHANNELD_FAIL_HTLC: handle_fail(peer, msg); return; - case WIRE_CHANNEL_SPECIFIC_FEERATES: + case WIRE_CHANNELD_SPECIFIC_FEERATES: handle_specific_feerates(peer, msg); return; - case WIRE_CHANNEL_SEND_SHUTDOWN: + case WIRE_CHANNELD_SEND_SHUTDOWN: handle_shutdown_cmd(peer, msg); return; - case WIRE_CHANNEL_SEND_ERROR: + case WIRE_CHANNELD_SEND_ERROR: handle_send_error(peer, msg); return; #if EXPERIMENTAL_FEATURES @@ -3073,32 +3073,32 @@ static void req_in(struct peer *peer, const u8 *msg) break; #endif /* !EXPERIMENTAL_FEATURES */ #if DEVELOPER - case WIRE_CHANNEL_DEV_REENABLE_COMMIT: + case WIRE_CHANNELD_DEV_REENABLE_COMMIT: handle_dev_reenable_commit(peer); return; - case WIRE_CHANNEL_DEV_MEMLEAK: + case WIRE_CHANNELD_DEV_MEMLEAK: handle_dev_memleak(peer, msg); return; #else - case WIRE_CHANNEL_DEV_REENABLE_COMMIT: - case WIRE_CHANNEL_DEV_MEMLEAK: + case WIRE_CHANNELD_DEV_REENABLE_COMMIT: + case WIRE_CHANNELD_DEV_MEMLEAK: #endif /* DEVELOPER */ - case WIRE_CHANNEL_INIT: - case WIRE_CHANNEL_OFFER_HTLC_REPLY: - case WIRE_CHANNEL_SENDING_COMMITSIG: - case WIRE_CHANNEL_GOT_COMMITSIG: - case WIRE_CHANNEL_GOT_REVOKE: - case WIRE_CHANNEL_SENDING_COMMITSIG_REPLY: - case WIRE_CHANNEL_GOT_COMMITSIG_REPLY: - case WIRE_CHANNEL_GOT_REVOKE_REPLY: - case WIRE_CHANNEL_GOT_FUNDING_LOCKED: - case WIRE_CHANNEL_GOT_ANNOUNCEMENT: - case WIRE_CHANNEL_GOT_SHUTDOWN: - case WIRE_CHANNEL_SHUTDOWN_COMPLETE: - case WIRE_CHANNEL_DEV_REENABLE_COMMIT_REPLY: - case WIRE_CHANNEL_FAIL_FALLEN_BEHIND: - case WIRE_CHANNEL_DEV_MEMLEAK_REPLY: - case WIRE_CHANNEL_SEND_ERROR_REPLY: + case WIRE_CHANNELD_INIT: + case WIRE_CHANNELD_OFFER_HTLC_REPLY: + case WIRE_CHANNELD_SENDING_COMMITSIG: + case WIRE_CHANNELD_GOT_COMMITSIG: + case WIRE_CHANNELD_GOT_REVOKE: + case WIRE_CHANNELD_SENDING_COMMITSIG_REPLY: + case WIRE_CHANNELD_GOT_COMMITSIG_REPLY: + case WIRE_CHANNELD_GOT_REVOKE_REPLY: + case WIRE_CHANNELD_GOT_FUNDING_LOCKED: + case WIRE_CHANNELD_GOT_ANNOUNCEMENT: + case WIRE_CHANNELD_GOT_SHUTDOWN: + case WIRE_CHANNELD_SHUTDOWN_COMPLETE: + case WIRE_CHANNELD_DEV_REENABLE_COMMIT_REPLY: + case WIRE_CHANNELD_FAIL_FALLEN_BEHIND: + case WIRE_CHANNELD_DEV_MEMLEAK_REPLY: + case WIRE_CHANNELD_SEND_ERROR_REPLY: case WIRE_GOT_ONIONMSG_TO_US: case WIRE_GOT_ONIONMSG_FORWARD: break; @@ -3152,7 +3152,7 @@ static void init_channel(struct peer *peer) status_setup_sync(MASTER_FD); msg = wire_sync_read(tmpctx, MASTER_FD); - if (!fromwire_channel_init(peer, msg, + if (!fromwire_channeld_init(peer, msg, &chainparams, &peer->our_features, &funding_txid, &funding_txout, @@ -3206,7 +3206,7 @@ static void init_channel(struct peer *peer) &dev_fast_gossip, &dev_fail_process_onionpacket, &pbases)) { - master_badmsg(WIRE_CHANNEL_INIT, msg); + master_badmsg(WIRE_CHANNELD_INIT, msg); } /* Keeping an array of pointers is better since it allows us to avoid @@ -3292,7 +3292,7 @@ static void init_channel(struct peer *peer) if (peer->channel->opener == LOCAL) peer->desired_feerate = channel_feerate(peer->channel, REMOTE); - /* from now we need keep watch over WIRE_CHANNEL_FUNDING_DEPTH */ + /* from now we need keep watch over WIRE_CHANNELD_FUNDING_DEPTH */ peer->depth_togo = minimum_depth; /* OK, now we can process peer messages. */ @@ -3313,7 +3313,7 @@ static void send_shutdown_complete(struct peer *peer) { /* Now we can tell master shutdown is complete. */ wire_sync_write(MASTER_FD, - take(towire_channel_shutdown_complete(NULL, peer->pps))); + take(towire_channeld_shutdown_complete(NULL, peer->pps))); per_peer_state_fdpass_send(MASTER_FD, peer->pps); close(MASTER_FD); } @@ -3390,7 +3390,7 @@ int main(int argc, char *argv[]) msg = msg_dequeue(peer->from_master); if (msg) { status_debug("Now dealing with deferred %s", - channel_wire_type_name( + channeld_wire_name( fromwire_peektype(msg))); req_in(peer, msg); tal_free(msg); diff --git a/channeld/channeld_wire.csv b/channeld/channeld_wire.csv new file mode 100644 index 000000000..d2603d78e --- /dev/null +++ b/channeld/channeld_wire.csv @@ -0,0 +1,230 @@ +#include +#include +#include +#include +#include +#include + +# Begin! (passes gossipd-client fd) +msgtype,channeld_init,1000 +msgdata,channeld_init,chainparams,chainparams, +msgdata,channeld_init,our_features,feature_set, +msgdata,channeld_init,funding_txid,bitcoin_txid, +msgdata,channeld_init,funding_txout,u16, +msgdata,channeld_init,funding_satoshi,amount_sat, +msgdata,channeld_init,minimum_depth,u32, +msgdata,channeld_init,our_config,channel_config, +msgdata,channeld_init,their_config,channel_config, +msgdata,channeld_init,fee_states,fee_states, +msgdata,channeld_init,feerate_min,u32, +msgdata,channeld_init,feerate_max,u32, +msgdata,channeld_init,feerate_penalty,u32, +msgdata,channeld_init,first_commit_sig,bitcoin_signature, +msgdata,channeld_init,per_peer_state,per_peer_state, +msgdata,channeld_init,remote_fundingkey,pubkey, +msgdata,channeld_init,remote_basepoints,basepoints, +msgdata,channeld_init,remote_per_commit,pubkey, +msgdata,channeld_init,old_remote_per_commit,pubkey, +msgdata,channeld_init,opener,enum side, +msgdata,channeld_init,fee_base,u32, +msgdata,channeld_init,fee_proportional,u32, +msgdata,channeld_init,local_msatoshi,amount_msat, +msgdata,channeld_init,our_basepoints,basepoints, +msgdata,channeld_init,our_funding_pubkey,pubkey, +msgdata,channeld_init,local_node_id,node_id, +msgdata,channeld_init,remote_node_id,node_id, +msgdata,channeld_init,commit_msec,u32, +msgdata,channeld_init,cltv_delta,u16, +msgdata,channeld_init,last_was_revoke,bool, +msgdata,channeld_init,num_last_sent_commit,u16, +msgdata,channeld_init,last_sent_commit,changed_htlc,num_last_sent_commit +msgdata,channeld_init,next_index_local,u64, +msgdata,channeld_init,next_index_remote,u64, +msgdata,channeld_init,revocations_received,u64, +msgdata,channeld_init,next_htlc_id,u64, +msgdata,channeld_init,num_existing_htlcs,u16, +msgdata,channeld_init,htlcs,existing_htlc,num_existing_htlcs +msgdata,channeld_init,local_funding_locked,bool, +msgdata,channeld_init,remote_funding_locked,bool, +msgdata,channeld_init,funding_short_id,short_channel_id, +msgdata,channeld_init,reestablish,bool, +msgdata,channeld_init,send_shutdown,bool, +msgdata,channeld_init,remote_shutdown_received,bool, +msgdata,channeld_init,final_scriptpubkey_len,u16, +msgdata,channeld_init,final_scriptpubkey,u8,final_scriptpubkey_len +msgdata,channeld_init,flags,u8, +msgdata,channeld_init,init_peer_pkt_len,u16, +msgdata,channeld_init,init_peer_pkt,u8,init_peer_pkt_len +msgdata,channeld_init,reached_announce_depth,bool, +msgdata,channeld_init,last_remote_secret,secret, +msgdata,channeld_init,flen,u16, +msgdata,channeld_init,their_features,u8,flen +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,dev_fast_gossip,bool, +msgdata,channeld_init,dev_fail_process_onionpacket,bool, +msgdata,channeld_init,num_penalty_bases,u32, +msgdata,channeld_init,pbases,penalty_base,num_penalty_bases + +# master->channeld funding hit new depth(funding locked if >= lock depth) +msgtype,channeld_funding_depth,1002 +msgdata,channeld_funding_depth,short_channel_id,?short_channel_id, +msgdata,channeld_funding_depth,depth,u32, + +# Tell channel to offer this htlc +msgtype,channeld_offer_htlc,1004 +msgdata,channeld_offer_htlc,amount_msat,amount_msat, +msgdata,channeld_offer_htlc,cltv_expiry,u32, +msgdata,channeld_offer_htlc,payment_hash,sha256, +msgdata,channeld_offer_htlc,onion_routing_packet,u8,1366 +msgdata,channeld_offer_htlc,blinding,?pubkey, + +# Reply; synchronous since IDs have to increment. +msgtype,channeld_offer_htlc_reply,1104 +msgdata,channeld_offer_htlc_reply,id,u64, +# Empty failure message means success. +msgdata,channeld_offer_htlc_reply,len,u16, +msgdata,channeld_offer_htlc_reply,failuremsg,u8,len +msgdata,channeld_offer_htlc_reply,failurestr,wirestring, + +# Main daemon found out the preimage for an HTLC +#include +msgtype,channeld_fulfill_htlc,1005 +msgdata,channeld_fulfill_htlc,fulfilled_htlc,fulfilled_htlc, + +# Main daemon says HTLC failed +msgtype,channeld_fail_htlc,1006 +msgdata,channeld_fail_htlc,failed_htlc,failed_htlc, + +# When we receive funding_locked. +msgtype,channeld_got_funding_locked,1019 +msgdata,channeld_got_funding_locked,next_per_commit_point,pubkey, + +#include + +# When we send a commitment_signed message, tell master. +msgtype,channeld_sending_commitsig,1020 +msgdata,channeld_sending_commitsig,commitnum,u64, +msgdata,channeld_sending_commitsig,pbase,?penalty_base, +msgdata,channeld_sending_commitsig,fee_states,fee_states, +# SENT_ADD_COMMIT, SENT_REMOVE_ACK_COMMIT, SENT_ADD_ACK_COMMIT, SENT_REMOVE_COMMIT +msgdata,channeld_sending_commitsig,num_changed,u16, +msgdata,channeld_sending_commitsig,changed,changed_htlc,num_changed +msgdata,channeld_sending_commitsig,commit_sig,bitcoin_signature, +msgdata,channeld_sending_commitsig,num_htlc_sigs,u16, +msgdata,channeld_sending_commitsig,htlc_sigs,bitcoin_signature,num_htlc_sigs + +# Wait for reply, to make sure it's on disk before we send commit. +msgtype,channeld_sending_commitsig_reply,1120 + +# When we have a commitment_signed message, tell master to remember. +msgtype,channeld_got_commitsig,1021 +msgdata,channeld_got_commitsig,commitnum,u64, +msgdata,channeld_got_commitsig,fee_states,fee_states, +msgdata,channeld_got_commitsig,signature,bitcoin_signature, +msgdata,channeld_got_commitsig,num_htlcs,u16, +msgdata,channeld_got_commitsig,htlc_signature,bitcoin_signature,num_htlcs +# RCVD_ADD_COMMIT: we're now committed to their new offered HTLCs. +msgdata,channeld_got_commitsig,num_added,u16, +msgdata,channeld_got_commitsig,added,added_htlc,num_added +# RCVD_REMOVE_COMMIT: we're now no longer committed to these HTLCs. +msgdata,channeld_got_commitsig,num_fulfilled,u16, +msgdata,channeld_got_commitsig,fulfilled,fulfilled_htlc,num_fulfilled +msgdata,channeld_got_commitsig,num_failed,u16, +msgdata,channeld_got_commitsig,failed,failed_htlc,num_failed +# RCVD_ADD_ACK_COMMIT, RCVD_REMOVE_ACK_COMMIT +msgdata,channeld_got_commitsig,num_changed,u16, +msgdata,channeld_got_commitsig,changed,changed_htlc,num_changed +msgdata,channeld_got_commitsig,tx,bitcoin_tx, + +# Wait for reply, to make sure it's on disk before we send revocation. +msgtype,channeld_got_commitsig_reply,1121 + +#include + +msgtype,channeld_got_revoke,1022 +msgdata,channeld_got_revoke,revokenum,u64, +msgdata,channeld_got_revoke,per_commitment_secret,secret, +msgdata,channeld_got_revoke,next_per_commit_point,pubkey, +# RCVD_ADD_ACK_REVOCATION, RCVD_REMOVE_ACK_REVOCATION, RCVD_ADD_REVOCATION, RCVD_REMOVE_REVOCATION +msgdata,channeld_got_revoke,fee_states,fee_states, +msgdata,channeld_got_revoke,num_changed,u16, +msgdata,channeld_got_revoke,changed,changed_htlc,num_changed +msgdata,channeld_got_revoke,pbase,?penalty_base, +msgdata,channeld_got_revoke,penalty_tx,?bitcoin_tx, +# Wait for reply, to make sure it's on disk before we continue +# (eg. if we sent another commitment_signed, that would implicitly ack). +msgtype,channeld_got_revoke_reply,1122 + +# Tell peer to shut down channel. +msgtype,channeld_send_shutdown,1023 +msgdata,channeld_send_shutdown,shutdown_len,u16, +msgdata,channeld_send_shutdown,shutdown_scriptpubkey,u8,shutdown_len + +# Peer told us that channel is shutting down +msgtype,channeld_got_shutdown,1024 +msgdata,channeld_got_shutdown,scriptpubkey_len,u16, +msgdata,channeld_got_shutdown,scriptpubkey,u8,scriptpubkey_len + +# Shutdown is complete, ready for closing negotiation. + peer_fd & gossip_fd. +msgtype,channeld_shutdown_complete,1025 +msgdata,channeld_shutdown_complete,per_peer_state,per_peer_state, + +# Re-enable commit timer. +msgtype,channeld_dev_reenable_commit,1026 +msgtype,channeld_dev_reenable_commit_reply,1126, + +msgtype,channeld_feerates,1027 +msgdata,channeld_feerates,feerate,u32, +msgdata,channeld_feerates,min_feerate,u32, +msgdata,channeld_feerates,max_feerate,u32, +msgdata,channeld_feerates,penalty_feerate,u32, + +# master -> channeld: do you have a memleak? +msgtype,channeld_dev_memleak,1033 + +msgtype,channeld_dev_memleak_reply,1133 +msgdata,channeld_dev_memleak_reply,leak,bool, + +# Peer presented proof it was from the future. +msgtype,channeld_fail_fallen_behind,1028 +# This is NULL if option_static_remotekey. +msgdata,channeld_fail_fallen_behind,remote_per_commitment_point,?pubkey, + +# Handle a channel specific feerate base ppm configuration +msgtype,channeld_specific_feerates,1029 +msgdata,channeld_specific_feerates,feerate_base,u32, +msgdata,channeld_specific_feerates,feerate_ppm,u32, + +# When we receive announcement_signatures for channel announce +msgtype,channeld_got_announcement,1017 +msgdata,channeld_got_announcement,remote_ann_node_sig,secp256k1_ecdsa_signature, +msgdata,channeld_got_announcement,remote_ann_bitcoin_sig,secp256k1_ecdsa_signature, + +# Ask channeld to send a error message. Used in forgetting channel case. +msgtype,channeld_send_error,1008 +msgdata,channeld_send_error,reason,wirestring, + +# Tell master channeld has sent the error message. +msgtype,channeld_send_error_reply,1108 + +# Tell lightningd we got a onion message (for us, or to fwd) +msgtype,got_onionmsg_to_us,1142 +msgdata,got_onionmsg_to_us,reply_blinding,?pubkey, +msgdata,got_onionmsg_to_us,reply_path_len,u16, +msgdata,got_onionmsg_to_us,reply_path,onionmsg_path,reply_path_len + +msgtype,got_onionmsg_forward,1143 +msgdata,got_onionmsg_forward,next_scid,?short_channel_id, +msgdata,got_onionmsg_forward,next_node_id,?node_id, +msgdata,got_onionmsg_forward,next_blinding,?pubkey, +msgdata,got_onionmsg_forward,next_onion,u8,1366 + +# Lightningd tells us to send a onion message. +msgtype,send_onionmsg,1040 +msgdata,send_onionmsg,onion,u8,1366 +msgdata,send_onionmsg,blinding,?pubkey, diff --git a/lightningd/channel_control.c b/lightningd/channel_control.c index a0dc5e743..31bb9dc12 100644 --- a/lightningd/channel_control.c +++ b/lightningd/channel_control.c @@ -1,7 +1,7 @@ #include #include #include -#include +#include #include #include #include @@ -39,10 +39,10 @@ static void update_feerates(struct lightningd *ld, struct channel *channel) if (!feerate) return; - msg = towire_channel_feerates(NULL, feerate, - feerate_min(ld, NULL), - feerate_max(ld, NULL), - try_get_feerate(ld->topology, FEERATE_PENALTY)); + msg = towire_channeld_feerates(NULL, feerate, + feerate_min(ld, NULL), + feerate_max(ld, NULL), + try_get_feerate(ld->topology, FEERATE_PENALTY)); subd_send_msg(channel->owner, take(msg)); } @@ -156,7 +156,7 @@ static void peer_got_funding_locked(struct channel *channel, const u8 *msg) { struct pubkey next_per_commitment_point; - if (!fromwire_channel_got_funding_locked(msg, + if (!fromwire_channeld_got_funding_locked(msg, &next_per_commitment_point)) { channel_internal_error(channel, "bad channel_got_funding_locked %s", @@ -183,7 +183,7 @@ static void peer_got_announcement(struct channel *channel, const u8 *msg) secp256k1_ecdsa_signature remote_ann_node_sig; secp256k1_ecdsa_signature remote_ann_bitcoin_sig; - if (!fromwire_channel_got_announcement(msg, + if (!fromwire_channeld_got_announcement(msg, &remote_ann_node_sig, &remote_ann_bitcoin_sig)) { channel_internal_error(channel, @@ -202,7 +202,7 @@ static void peer_got_shutdown(struct channel *channel, const u8 *msg) u8 *scriptpubkey; struct lightningd *ld = channel->peer->ld; - if (!fromwire_channel_got_shutdown(channel, msg, &scriptpubkey)) { + if (!fromwire_channeld_got_shutdown(channel, msg, &scriptpubkey)) { channel_internal_error(channel, "bad channel_got_shutdown %s", tal_hex(msg, msg)); return; @@ -243,7 +243,7 @@ static void peer_got_shutdown(struct channel *channel, const u8 *msg) static void channel_fail_fallen_behind(struct channel *channel, const u8 *msg) { - if (!fromwire_channel_fail_fallen_behind(channel, msg, + if (!fromwire_channeld_fail_fallen_behind(channel, msg, cast_const2(struct pubkey **, &channel->future_per_commitment_point))) { channel_internal_error(channel, @@ -277,7 +277,7 @@ static void peer_start_closingd_after_shutdown(struct channel *channel, { struct per_peer_state *pps; - if (!fromwire_channel_shutdown_complete(tmpctx, msg, &pps)) { + if (!fromwire_channeld_shutdown_complete(tmpctx, msg, &pps)) { channel_internal_error(channel, "bad shutdown_complete: %s", tal_hex(msg, msg)); return; @@ -312,7 +312,7 @@ static void forget(struct channel *channel) static void handle_error_channel(struct channel *channel, const u8 *msg) { - if (!fromwire_channel_send_error_reply(msg)) { + if (!fromwire_channeld_send_error_reply(msg)) { channel_internal_error(channel, "bad send_error_reply: %s", tal_hex(tmpctx, msg)); return; @@ -333,44 +333,44 @@ void forget_channel(struct channel *channel, const char *why) * we just directly remove the channel */ if (channel->owner) subd_send_msg(channel->owner, - take(towire_channel_send_error(NULL, why))); + take(towire_channeld_send_error(NULL, why))); else forget(channel); } static unsigned channel_msg(struct subd *sd, const u8 *msg, const int *fds) { - enum channel_wire_type t = fromwire_peektype(msg); + enum channeld_wire t = fromwire_peektype(msg); switch (t) { - case WIRE_CHANNEL_SENDING_COMMITSIG: + case WIRE_CHANNELD_SENDING_COMMITSIG: peer_sending_commitsig(sd->channel, msg); break; - case WIRE_CHANNEL_GOT_COMMITSIG: + case WIRE_CHANNELD_GOT_COMMITSIG: peer_got_commitsig(sd->channel, msg); break; - case WIRE_CHANNEL_GOT_REVOKE: + case WIRE_CHANNELD_GOT_REVOKE: peer_got_revoke(sd->channel, msg); break; - case WIRE_CHANNEL_GOT_FUNDING_LOCKED: + case WIRE_CHANNELD_GOT_FUNDING_LOCKED: peer_got_funding_locked(sd->channel, msg); break; - case WIRE_CHANNEL_GOT_ANNOUNCEMENT: + case WIRE_CHANNELD_GOT_ANNOUNCEMENT: peer_got_announcement(sd->channel, msg); break; - case WIRE_CHANNEL_GOT_SHUTDOWN: + case WIRE_CHANNELD_GOT_SHUTDOWN: peer_got_shutdown(sd->channel, msg); break; - case WIRE_CHANNEL_SHUTDOWN_COMPLETE: + case WIRE_CHANNELD_SHUTDOWN_COMPLETE: /* We expect 3 fds. */ if (!fds) return 3; peer_start_closingd_after_shutdown(sd->channel, msg, fds); break; - case WIRE_CHANNEL_FAIL_FALLEN_BEHIND: + case WIRE_CHANNELD_FAIL_FALLEN_BEHIND: channel_fail_fallen_behind(sd->channel, msg); break; - case WIRE_CHANNEL_SEND_ERROR_REPLY: + case WIRE_CHANNELD_SEND_ERROR_REPLY: handle_error_channel(sd->channel, msg); break; #if EXPERIMENTAL_FEATURES @@ -385,25 +385,25 @@ static unsigned channel_msg(struct subd *sd, const u8 *msg, const int *fds) case WIRE_GOT_ONIONMSG_FORWARD: #endif /* And we never get these from channeld. */ - case WIRE_CHANNEL_INIT: - case WIRE_CHANNEL_FUNDING_DEPTH: - case WIRE_CHANNEL_OFFER_HTLC: - case WIRE_CHANNEL_FULFILL_HTLC: - case WIRE_CHANNEL_FAIL_HTLC: - case WIRE_CHANNEL_GOT_COMMITSIG_REPLY: - case WIRE_CHANNEL_GOT_REVOKE_REPLY: - case WIRE_CHANNEL_SENDING_COMMITSIG_REPLY: - case WIRE_CHANNEL_SEND_SHUTDOWN: - case WIRE_CHANNEL_DEV_REENABLE_COMMIT: - case WIRE_CHANNEL_FEERATES: - case WIRE_CHANNEL_SPECIFIC_FEERATES: - case WIRE_CHANNEL_DEV_MEMLEAK: + case WIRE_CHANNELD_INIT: + case WIRE_CHANNELD_FUNDING_DEPTH: + case WIRE_CHANNELD_OFFER_HTLC: + case WIRE_CHANNELD_FULFILL_HTLC: + case WIRE_CHANNELD_FAIL_HTLC: + case WIRE_CHANNELD_GOT_COMMITSIG_REPLY: + case WIRE_CHANNELD_GOT_REVOKE_REPLY: + case WIRE_CHANNELD_SENDING_COMMITSIG_REPLY: + case WIRE_CHANNELD_SEND_SHUTDOWN: + case WIRE_CHANNELD_DEV_REENABLE_COMMIT: + case WIRE_CHANNELD_FEERATES: + case WIRE_CHANNELD_SPECIFIC_FEERATES: + case WIRE_CHANNELD_DEV_MEMLEAK: case WIRE_SEND_ONIONMSG: /* Replies go to requests. */ - case WIRE_CHANNEL_OFFER_HTLC_REPLY: - case WIRE_CHANNEL_DEV_REENABLE_COMMIT_REPLY: - case WIRE_CHANNEL_DEV_MEMLEAK_REPLY: - case WIRE_CHANNEL_SEND_ERROR: + case WIRE_CHANNELD_OFFER_HTLC_REPLY: + case WIRE_CHANNELD_DEV_REENABLE_COMMIT_REPLY: + case WIRE_CHANNELD_DEV_MEMLEAK_REPLY: + case WIRE_CHANNELD_SEND_ERROR: break; } @@ -453,7 +453,7 @@ void peer_start_channeld(struct channel *channel, "lightning_channeld", channel, &channel->peer->id, channel->log, true, - channel_wire_type_name, + channeld_wire_name, channel_msg, channel_errmsg, channel_set_billboard, @@ -521,7 +521,7 @@ void peer_start_channeld(struct channel *channel, pbases = wallet_penalty_base_load_for_channel( tmpctx, channel->peer->ld->wallet, channel->dbid); - initmsg = towire_channel_init(tmpctx, + initmsg = towire_channeld_init(tmpctx, chainparams, ld->our_features, &channel->funding_txid, @@ -614,7 +614,7 @@ bool channel_tell_depth(struct lightningd *ld, } subd_send_msg(channel->owner, - take(towire_channel_funding_depth(NULL, channel->scid, + take(towire_channeld_funding_depth(NULL, channel->scid, depth))); if (channel->remote_funding_locked @@ -867,7 +867,7 @@ static struct command_result *json_dev_feerate(struct command *cmd, if (!channel || !channel->owner || channel->state != CHANNELD_NORMAL) return command_fail(cmd, LIGHTNINGD, "Peer bad state"); - msg = towire_channel_feerates(NULL, *feerate, + msg = towire_channeld_feerates(NULL, *feerate, feerate_min(cmd->ld, NULL), feerate_max(cmd->ld, NULL), try_get_feerate(cmd->ld->topology, FEERATE_PENALTY)); diff --git a/lightningd/onion_message.c b/lightningd/onion_message.c index 9e219c675..284ef8cbd 100644 --- a/lightningd/onion_message.c +++ b/lightningd/onion_message.c @@ -1,4 +1,4 @@ -#include +#include #include #include #include @@ -63,13 +63,13 @@ static bool make_peer_send(struct lightningd *ld, if (!dst) { log_debug(ld->log, "Can't send %s: no channel", - channel_wire_type_name(fromwire_peektype(msg))); + channeld_wire_name(fromwire_peektype(msg))); return false; } if (!dst->owner) { log_debug(ld->log, "Can't send %s: not connected", - channel_wire_type_name(fromwire_peektype(msg))); + channeld_wire_name(fromwire_peektype(msg))); return false; } @@ -77,7 +77,7 @@ static bool make_peer_send(struct lightningd *ld, * allow incoming via openingd!. */ if (!streq(dst->owner->name, "channeld")) { log_debug(ld->log, "Can't send %s: owned by %s", - channel_wire_type_name(fromwire_peektype(msg)), + channeld_wire_name(fromwire_peektype(msg)), dst->owner->name); return false; } diff --git a/lightningd/peer_control.c b/lightningd/peer_control.c index 84532ddea..7869532ab 100644 --- a/lightningd/peer_control.c +++ b/lightningd/peer_control.c @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include @@ -1435,7 +1435,7 @@ static struct command_result *json_close(struct command *cmd, case CHANNELD_SHUTTING_DOWN: if (channel->owner) subd_send_msg(channel->owner, - take(towire_channel_send_shutdown(NULL, + take(towire_channeld_send_shutdown(NULL, channel->shutdown_scriptpubkey[LOCAL]))); break; case CLOSINGD_SIGEXCHANGE: @@ -1869,7 +1869,7 @@ static void set_channel_fees(struct command *cmd, struct channel *channel, /* tell channeld to make a send_channel_update */ if (channel->owner && streq(channel->owner->name, "channeld")) subd_send_msg(channel->owner, - take(towire_channel_specific_feerates(NULL, base, ppm))); + take(towire_channeld_specific_feerates(NULL, base, ppm))); /* save values to database */ wallet_channel_save(cmd->ld->wallet, channel); @@ -2079,7 +2079,7 @@ static struct command_result *json_dev_reenable_commit(struct command *cmd, "Peer owned by %s", channel->owner->name); } - msg = towire_channel_dev_reenable_commit(channel); + msg = towire_channeld_dev_reenable_commit(channel); subd_req(peer, channel->owner, take(msg), -1, 0, dev_reenable_commit_finished, cmd); return command_still_pending(cmd); @@ -2238,7 +2238,7 @@ static void channeld_memleak_req_done(struct subd *channeld, bool found_leak; tal_del_destructor2(channeld, subd_died_forget_memleak, cmd); - if (!fromwire_channel_dev_memleak_reply(msg, &found_leak)) { + if (!fromwire_channeld_dev_memleak_reply(msg, &found_leak)) { was_pending(command_fail(cmd, LIGHTNINGD, "Bad channel_dev_memleak")); return; @@ -2283,7 +2283,7 @@ static void peer_memleak_req_next(struct command *cmd, struct channel *prev) /* Note: closingd does its own checking automatically */ if (streq(c->owner->name, "channeld")) { subd_req(c, c->owner, - take(towire_channel_dev_memleak(NULL)), + take(towire_channeld_dev_memleak(NULL)), -1, 0, channeld_memleak_req_done, cmd); tal_add_destructor2(c->owner, subd_died_forget_memleak, diff --git a/lightningd/peer_htlcs.c b/lightningd/peer_htlcs.c index e692175a3..89066f946 100644 --- a/lightningd/peer_htlcs.c +++ b/lightningd/peer_htlcs.c @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include #include #include @@ -147,7 +147,7 @@ static void tell_channeld_htlc_failed(const struct htlc_in *hin, return; subd_send_msg(hin->key.channel->owner, - take(towire_channel_fail_htlc(NULL, failed_htlc))); + take(towire_channeld_fail_htlc(NULL, failed_htlc))); } struct failmsg_update_cbdata { @@ -434,7 +434,7 @@ void fulfill_htlc(struct htlc_in *hin, const struct preimage *preimage) struct fulfilled_htlc fulfilled_htlc; fulfilled_htlc.id = hin->key.id; fulfilled_htlc.payment_preimage = *preimage; - msg = towire_channel_fulfill_htlc(hin, &fulfilled_htlc); + msg = towire_channeld_fulfill_htlc(hin, &fulfilled_htlc); } subd_send_msg(channel->owner, take(msg)); } @@ -543,7 +543,7 @@ static void rcvd_htlc_reply(struct subd *subd, const u8 *msg, const int *fds UNU char *failurestr; struct lightningd *ld = subd->ld; - if (!fromwire_channel_offer_htlc_reply(msg, msg, + if (!fromwire_channeld_offer_htlc_reply(msg, msg, &hout->key.id, &failmsg, &failurestr)) { @@ -664,7 +664,7 @@ const u8 *send_htlc_out(const tal_t *ctx, out, time_from_sec(30), htlc_offer_timeout, out); - msg = towire_channel_offer_htlc(out, amount, cltv, payment_hash, + msg = towire_channeld_offer_htlc(out, amount, cltv, payment_hash, onion_routing_packet, blinding); subd_req(out->peer->ld, out->owner, take(msg), -1, 0, rcvd_htlc_reply, *houtp); @@ -1706,7 +1706,7 @@ void peer_sending_commitsig(struct channel *channel, const u8 *msg) channel->htlc_timeout = tal_free(channel->htlc_timeout); - if (!fromwire_channel_sending_commitsig(msg, msg, + if (!fromwire_channeld_sending_commitsig(msg, msg, &commitnum, &pbase, &fee_states, @@ -1769,7 +1769,7 @@ void peer_sending_commitsig(struct channel *channel, const u8 *msg) /* Tell it we've got it, and to go ahead with commitment_signed. */ subd_send_msg(channel->owner, - take(towire_channel_sending_commitsig_reply(msg))); + take(towire_channeld_sending_commitsig_reply(msg))); } static bool channel_added_their_htlc(struct channel *channel, @@ -1899,7 +1899,7 @@ void peer_got_commitsig(struct channel *channel, const u8 *msg) size_t i; struct lightningd *ld = channel->peer->ld; - if (!fromwire_channel_got_commitsig(msg, msg, + if (!fromwire_channeld_got_commitsig(msg, msg, &commitnum, &fee_states, &commit_sig, @@ -1911,7 +1911,7 @@ void peer_got_commitsig(struct channel *channel, const u8 *msg) &tx) || !fee_states_valid(fee_states, channel->opener)) { channel_internal_error(channel, - "bad fromwire_channel_got_commitsig %s", + "bad fromwire_channeld_got_commitsig %s", tal_hex(channel, msg)); return; } @@ -1990,7 +1990,7 @@ void peer_got_commitsig(struct channel *channel, const u8 *msg) channel->last_htlc_sigs); /* Tell it we've committed, and to go ahead with revoke. */ - msg = towire_channel_got_commitsig_reply(msg); + msg = towire_channeld_got_commitsig_reply(msg); subd_send_msg(channel->owner, take(msg)); } @@ -2053,7 +2053,7 @@ void peer_got_revoke(struct channel *channel, const u8 *msg) struct commitment_revocation_payload *payload; struct bitcoin_tx *penalty_tx; - if (!fromwire_channel_got_revoke(msg, msg, + if (!fromwire_channeld_got_revoke(msg, msg, &revokenum, &per_commitment_secret, &next_per_commitment_point, &fee_states, @@ -2061,7 +2061,7 @@ void peer_got_revoke(struct channel *channel, const u8 *msg) &pbase, &penalty_tx) || !fee_states_valid(fee_states, channel->opener)) { - channel_internal_error(channel, "bad fromwire_channel_got_revoke %s", + channel_internal_error(channel, "bad fromwire_channeld_got_revoke %s", tal_hex(channel, msg)); return; } @@ -2126,7 +2126,7 @@ void peer_got_revoke(struct channel *channel, const u8 *msg) update_per_commit_point(channel, &next_per_commitment_point); /* Tell it we've committed, and to go ahead with revoke. */ - msg = towire_channel_got_revoke_reply(msg); + msg = towire_channeld_got_revoke_reply(msg); subd_send_msg(channel->owner, take(msg)); /* Now, any HTLCs we need to immediately fail? */ diff --git a/lightningd/ping.c b/lightningd/ping.c index 47b4335cb..207477da8 100644 --- a/lightningd/ping.c +++ b/lightningd/ping.c @@ -1,4 +1,4 @@ -#include +#include #include #include #include diff --git a/lightningd/test/run-invoice-select-inchan.c b/lightningd/test/run-invoice-select-inchan.c index 7ad199ddd..721b7cb8e 100644 --- a/lightningd/test/run-invoice-select-inchan.c +++ b/lightningd/test/run-invoice-select-inchan.c @@ -106,13 +106,13 @@ void fixup_htlcs_out(struct lightningd *ld UNNEEDED) /* Generated stub for fromwire_bigsize */ bigsize_t fromwire_bigsize(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) { fprintf(stderr, "fromwire_bigsize called!\n"); abort(); } -/* Generated stub for fromwire_channel_dev_memleak_reply */ -bool fromwire_channel_dev_memleak_reply(const void *p UNNEEDED, bool *leak UNNEEDED) -{ fprintf(stderr, "fromwire_channel_dev_memleak_reply called!\n"); abort(); } /* Generated stub for fromwire_channel_id */ void fromwire_channel_id(const u8 **cursor UNNEEDED, size_t *max UNNEEDED, struct channel_id *channel_id UNNEEDED) { fprintf(stderr, "fromwire_channel_id 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(); } /* Generated stub for fromwire_connect_peer_connected */ bool fromwire_connect_peer_connected(const tal_t *ctx UNNEEDED, const void *p UNNEEDED, struct node_id *id UNNEEDED, struct wireaddr_internal *addr UNNEEDED, struct per_peer_state **pps UNNEEDED, u8 **features UNNEEDED) { fprintf(stderr, "fromwire_connect_peer_connected called!\n"); abort(); } @@ -461,21 +461,21 @@ void subd_send_msg(struct subd *sd UNNEEDED, const u8 *msg_out UNNEEDED) /* Generated stub for towire_bigsize */ void towire_bigsize(u8 **pptr UNNEEDED, const bigsize_t val UNNEEDED) { fprintf(stderr, "towire_bigsize called!\n"); abort(); } -/* Generated stub for towire_channel_dev_memleak */ -u8 *towire_channel_dev_memleak(const tal_t *ctx UNNEEDED) -{ fprintf(stderr, "towire_channel_dev_memleak called!\n"); abort(); } -/* Generated stub for towire_channel_dev_reenable_commit */ -u8 *towire_channel_dev_reenable_commit(const tal_t *ctx UNNEEDED) -{ fprintf(stderr, "towire_channel_dev_reenable_commit called!\n"); abort(); } /* Generated stub for towire_channel_id */ void towire_channel_id(u8 **pptr UNNEEDED, const struct channel_id *channel_id UNNEEDED) { fprintf(stderr, "towire_channel_id called!\n"); abort(); } -/* Generated stub for towire_channel_send_shutdown */ -u8 *towire_channel_send_shutdown(const tal_t *ctx UNNEEDED, const u8 *shutdown_scriptpubkey UNNEEDED) -{ fprintf(stderr, "towire_channel_send_shutdown called!\n"); abort(); } -/* Generated stub for towire_channel_specific_feerates */ -u8 *towire_channel_specific_feerates(const tal_t *ctx UNNEEDED, u32 feerate_base UNNEEDED, u32 feerate_ppm UNNEEDED) -{ fprintf(stderr, "towire_channel_specific_feerates called!\n"); abort(); } +/* Generated stub for towire_channeld_dev_memleak */ +u8 *towire_channeld_dev_memleak(const tal_t *ctx UNNEEDED) +{ fprintf(stderr, "towire_channeld_dev_memleak called!\n"); abort(); } +/* Generated stub for towire_channeld_dev_reenable_commit */ +u8 *towire_channeld_dev_reenable_commit(const tal_t *ctx UNNEEDED) +{ fprintf(stderr, "towire_channeld_dev_reenable_commit called!\n"); abort(); } +/* Generated stub for towire_channeld_send_shutdown */ +u8 *towire_channeld_send_shutdown(const tal_t *ctx UNNEEDED, const u8 *shutdown_scriptpubkey UNNEEDED) +{ fprintf(stderr, "towire_channeld_send_shutdown called!\n"); abort(); } +/* Generated stub for towire_channeld_specific_feerates */ +u8 *towire_channeld_specific_feerates(const tal_t *ctx UNNEEDED, u32 feerate_base UNNEEDED, u32 feerate_ppm UNNEEDED) +{ fprintf(stderr, "towire_channeld_specific_feerates called!\n"); abort(); } /* Generated stub for towire_connectctl_connect_to_peer */ u8 *towire_connectctl_connect_to_peer(const tal_t *ctx UNNEEDED, const struct node_id *id UNNEEDED, u32 seconds_waited UNNEEDED, const struct wireaddr_internal *addrhint UNNEEDED) { fprintf(stderr, "towire_connectctl_connect_to_peer called!\n"); abort(); } diff --git a/lightningd/test/run-jsonrpc.c b/lightningd/test/run-jsonrpc.c index b2a488f9f..19d95c540 100644 --- a/lightningd/test/run-jsonrpc.c +++ b/lightningd/test/run-jsonrpc.c @@ -29,12 +29,6 @@ void fromwire_node_id(const u8 **cursor UNNEEDED, size_t *max UNNEEDED, struct n void json_add_sha256(struct json_stream *result UNNEEDED, const char *fieldname UNNEEDED, const struct sha256 *hash UNNEEDED) { fprintf(stderr, "json_add_sha256 called!\n"); abort(); } -/* Generated stub for json_to_address_scriptpubkey */ -enum address_parse_result json_to_address_scriptpubkey(const tal_t *ctx UNNEEDED, - const struct chainparams *chainparams UNNEEDED, - const char *buffer UNNEEDED, - const jsmntok_t *tok UNNEEDED, const u8 **scriptpubkey UNNEEDED) -{ fprintf(stderr, "json_to_address_scriptpubkey called!\n"); abort(); } /* Generated stub for json_to_pubkey */ bool json_to_pubkey(const char *buffer UNNEEDED, const jsmntok_t *tok UNNEEDED, struct pubkey *pubkey UNNEEDED) diff --git a/wallet/test/run-wallet.c b/wallet/test/run-wallet.c index d2a4db597..56f5e157b 100644 --- a/wallet/test/run-wallet.c +++ b/wallet/test/run-wallet.c @@ -111,21 +111,21 @@ 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 fromwire_channel_dev_memleak_reply */ -bool fromwire_channel_dev_memleak_reply(const void *p UNNEEDED, bool *leak UNNEEDED) -{ fprintf(stderr, "fromwire_channel_dev_memleak_reply called!\n"); abort(); } -/* Generated stub for fromwire_channel_got_commitsig */ -bool fromwire_channel_got_commitsig(const tal_t *ctx UNNEEDED, const void *p UNNEEDED, u64 *commitnum UNNEEDED, struct fee_states **fee_states UNNEEDED, struct bitcoin_signature *signature UNNEEDED, struct bitcoin_signature **htlc_signature UNNEEDED, struct added_htlc **added UNNEEDED, struct fulfilled_htlc **fulfilled UNNEEDED, struct failed_htlc ***failed UNNEEDED, struct changed_htlc **changed UNNEEDED, struct bitcoin_tx **tx UNNEEDED) -{ fprintf(stderr, "fromwire_channel_got_commitsig called!\n"); abort(); } -/* Generated stub for fromwire_channel_got_revoke */ -bool fromwire_channel_got_revoke(const tal_t *ctx UNNEEDED, const void *p UNNEEDED, u64 *revokenum UNNEEDED, struct secret *per_commitment_secret UNNEEDED, struct pubkey *next_per_commit_point UNNEEDED, struct fee_states **fee_states UNNEEDED, struct changed_htlc **changed UNNEEDED, struct penalty_base **pbase UNNEEDED, struct bitcoin_tx **penalty_tx UNNEEDED) -{ fprintf(stderr, "fromwire_channel_got_revoke called!\n"); abort(); } -/* Generated stub for fromwire_channel_offer_htlc_reply */ -bool fromwire_channel_offer_htlc_reply(const tal_t *ctx UNNEEDED, const void *p UNNEEDED, u64 *id UNNEEDED, u8 **failuremsg UNNEEDED, wirestring **failurestr UNNEEDED) -{ fprintf(stderr, "fromwire_channel_offer_htlc_reply called!\n"); abort(); } -/* Generated stub for fromwire_channel_sending_commitsig */ -bool fromwire_channel_sending_commitsig(const tal_t *ctx UNNEEDED, const void *p UNNEEDED, u64 *commitnum UNNEEDED, struct penalty_base **pbase UNNEEDED, struct fee_states **fee_states UNNEEDED, struct changed_htlc **changed UNNEEDED, struct bitcoin_signature *commit_sig UNNEEDED, struct bitcoin_signature **htlc_sigs UNNEEDED) -{ fprintf(stderr, "fromwire_channel_sending_commitsig 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(); } +/* Generated stub for fromwire_channeld_got_commitsig */ +bool fromwire_channeld_got_commitsig(const tal_t *ctx UNNEEDED, const void *p UNNEEDED, u64 *commitnum UNNEEDED, struct fee_states **fee_states UNNEEDED, struct bitcoin_signature *signature UNNEEDED, struct bitcoin_signature **htlc_signature UNNEEDED, struct added_htlc **added UNNEEDED, struct fulfilled_htlc **fulfilled UNNEEDED, struct failed_htlc ***failed UNNEEDED, struct changed_htlc **changed UNNEEDED, struct bitcoin_tx **tx UNNEEDED) +{ fprintf(stderr, "fromwire_channeld_got_commitsig called!\n"); abort(); } +/* Generated stub for fromwire_channeld_got_revoke */ +bool fromwire_channeld_got_revoke(const tal_t *ctx UNNEEDED, const void *p UNNEEDED, u64 *revokenum UNNEEDED, struct secret *per_commitment_secret UNNEEDED, struct pubkey *next_per_commit_point UNNEEDED, struct fee_states **fee_states UNNEEDED, struct changed_htlc **changed UNNEEDED, struct penalty_base **pbase UNNEEDED, struct bitcoin_tx **penalty_tx UNNEEDED) +{ fprintf(stderr, "fromwire_channeld_got_revoke called!\n"); abort(); } +/* Generated stub for fromwire_channeld_offer_htlc_reply */ +bool fromwire_channeld_offer_htlc_reply(const tal_t *ctx UNNEEDED, const void *p UNNEEDED, u64 *id UNNEEDED, u8 **failuremsg UNNEEDED, wirestring **failurestr UNNEEDED) +{ fprintf(stderr, "fromwire_channeld_offer_htlc_reply called!\n"); abort(); } +/* Generated stub for fromwire_channeld_sending_commitsig */ +bool fromwire_channeld_sending_commitsig(const tal_t *ctx UNNEEDED, const void *p UNNEEDED, u64 *commitnum UNNEEDED, struct penalty_base **pbase UNNEEDED, struct fee_states **fee_states UNNEEDED, struct changed_htlc **changed UNNEEDED, struct bitcoin_signature *commit_sig UNNEEDED, struct bitcoin_signature **htlc_sigs UNNEEDED) +{ fprintf(stderr, "fromwire_channeld_sending_commitsig called!\n"); abort(); } /* Generated stub for fromwire_connect_peer_connected */ bool fromwire_connect_peer_connected(const tal_t *ctx UNNEEDED, const void *p UNNEEDED, struct node_id *id UNNEEDED, struct wireaddr_internal *addr UNNEEDED, struct per_peer_state **pps UNNEEDED, u8 **features UNNEEDED) { fprintf(stderr, "fromwire_connect_peer_connected called!\n"); abort(); } @@ -631,39 +631,39 @@ void topology_add_sync_waiter_(const tal_t *ctx UNNEEDED, void *arg) UNNEEDED, void *arg UNNEEDED) { fprintf(stderr, "topology_add_sync_waiter_ called!\n"); abort(); } -/* Generated stub for towire_channel_dev_memleak */ -u8 *towire_channel_dev_memleak(const tal_t *ctx UNNEEDED) -{ fprintf(stderr, "towire_channel_dev_memleak called!\n"); abort(); } -/* Generated stub for towire_channel_dev_reenable_commit */ -u8 *towire_channel_dev_reenable_commit(const tal_t *ctx UNNEEDED) -{ fprintf(stderr, "towire_channel_dev_reenable_commit called!\n"); abort(); } /* Generated stub for towire_channel_disabled */ u8 *towire_channel_disabled(const tal_t *ctx UNNEEDED) { fprintf(stderr, "towire_channel_disabled called!\n"); abort(); } -/* Generated stub for towire_channel_fail_htlc */ -u8 *towire_channel_fail_htlc(const tal_t *ctx UNNEEDED, const struct failed_htlc *failed_htlc UNNEEDED) -{ fprintf(stderr, "towire_channel_fail_htlc called!\n"); abort(); } -/* Generated stub for towire_channel_fulfill_htlc */ -u8 *towire_channel_fulfill_htlc(const tal_t *ctx UNNEEDED, const struct fulfilled_htlc *fulfilled_htlc UNNEEDED) -{ fprintf(stderr, "towire_channel_fulfill_htlc called!\n"); abort(); } -/* Generated stub for towire_channel_got_commitsig_reply */ -u8 *towire_channel_got_commitsig_reply(const tal_t *ctx UNNEEDED) -{ fprintf(stderr, "towire_channel_got_commitsig_reply called!\n"); abort(); } -/* Generated stub for towire_channel_got_revoke_reply */ -u8 *towire_channel_got_revoke_reply(const tal_t *ctx UNNEEDED) -{ fprintf(stderr, "towire_channel_got_revoke_reply called!\n"); abort(); } -/* Generated stub for towire_channel_offer_htlc */ -u8 *towire_channel_offer_htlc(const tal_t *ctx UNNEEDED, struct amount_msat amount_msat UNNEEDED, u32 cltv_expiry UNNEEDED, const struct sha256 *payment_hash UNNEEDED, const u8 onion_routing_packet[1366] UNNEEDED, const struct pubkey *blinding UNNEEDED) -{ fprintf(stderr, "towire_channel_offer_htlc called!\n"); abort(); } -/* Generated stub for towire_channel_send_shutdown */ -u8 *towire_channel_send_shutdown(const tal_t *ctx UNNEEDED, const u8 *shutdown_scriptpubkey UNNEEDED) -{ fprintf(stderr, "towire_channel_send_shutdown called!\n"); abort(); } -/* Generated stub for towire_channel_sending_commitsig_reply */ -u8 *towire_channel_sending_commitsig_reply(const tal_t *ctx UNNEEDED) -{ fprintf(stderr, "towire_channel_sending_commitsig_reply called!\n"); abort(); } -/* Generated stub for towire_channel_specific_feerates */ -u8 *towire_channel_specific_feerates(const tal_t *ctx UNNEEDED, u32 feerate_base UNNEEDED, u32 feerate_ppm UNNEEDED) -{ fprintf(stderr, "towire_channel_specific_feerates called!\n"); abort(); } +/* Generated stub for towire_channeld_dev_memleak */ +u8 *towire_channeld_dev_memleak(const tal_t *ctx UNNEEDED) +{ fprintf(stderr, "towire_channeld_dev_memleak called!\n"); abort(); } +/* Generated stub for towire_channeld_dev_reenable_commit */ +u8 *towire_channeld_dev_reenable_commit(const tal_t *ctx UNNEEDED) +{ fprintf(stderr, "towire_channeld_dev_reenable_commit called!\n"); abort(); } +/* Generated stub for towire_channeld_fail_htlc */ +u8 *towire_channeld_fail_htlc(const tal_t *ctx UNNEEDED, const struct failed_htlc *failed_htlc UNNEEDED) +{ fprintf(stderr, "towire_channeld_fail_htlc called!\n"); abort(); } +/* Generated stub for towire_channeld_fulfill_htlc */ +u8 *towire_channeld_fulfill_htlc(const tal_t *ctx UNNEEDED, const struct fulfilled_htlc *fulfilled_htlc UNNEEDED) +{ fprintf(stderr, "towire_channeld_fulfill_htlc called!\n"); abort(); } +/* Generated stub for towire_channeld_got_commitsig_reply */ +u8 *towire_channeld_got_commitsig_reply(const tal_t *ctx UNNEEDED) +{ fprintf(stderr, "towire_channeld_got_commitsig_reply called!\n"); abort(); } +/* Generated stub for towire_channeld_got_revoke_reply */ +u8 *towire_channeld_got_revoke_reply(const tal_t *ctx UNNEEDED) +{ fprintf(stderr, "towire_channeld_got_revoke_reply called!\n"); abort(); } +/* Generated stub for towire_channeld_offer_htlc */ +u8 *towire_channeld_offer_htlc(const tal_t *ctx UNNEEDED, struct amount_msat amount_msat UNNEEDED, u32 cltv_expiry UNNEEDED, const struct sha256 *payment_hash UNNEEDED, const u8 onion_routing_packet[1366] UNNEEDED, const struct pubkey *blinding UNNEEDED) +{ fprintf(stderr, "towire_channeld_offer_htlc called!\n"); abort(); } +/* Generated stub for towire_channeld_send_shutdown */ +u8 *towire_channeld_send_shutdown(const tal_t *ctx UNNEEDED, const u8 *shutdown_scriptpubkey UNNEEDED) +{ fprintf(stderr, "towire_channeld_send_shutdown called!\n"); abort(); } +/* Generated stub for towire_channeld_sending_commitsig_reply */ +u8 *towire_channeld_sending_commitsig_reply(const tal_t *ctx UNNEEDED) +{ fprintf(stderr, "towire_channeld_sending_commitsig_reply called!\n"); abort(); } +/* Generated stub for towire_channeld_specific_feerates */ +u8 *towire_channeld_specific_feerates(const tal_t *ctx UNNEEDED, u32 feerate_base UNNEEDED, u32 feerate_ppm UNNEEDED) +{ fprintf(stderr, "towire_channeld_specific_feerates called!\n"); abort(); } /* Generated stub for towire_connectctl_connect_to_peer */ u8 *towire_connectctl_connect_to_peer(const tal_t *ctx UNNEEDED, const struct node_id *id UNNEEDED, u32 seconds_waited UNNEEDED, const struct wireaddr_internal *addrhint UNNEEDED) { fprintf(stderr, "towire_connectctl_connect_to_peer called!\n"); abort(); }