Makefile: create generic wiregen rules, use for channeld.

This means some files get renamed, and I took the opportunity to clarify
our naming (the *d* is important!)

1. channeld/channel_wire.csv -> channeld/channeld_wire.csv
2. channeld/gen_channel_wire.h -> channeld/channeld_wiregen.h
3. enum channel_wire_type -> enum channeld_wire
4. WIRE_CHANNEL_FUNDING_DEPTH -> WIRE_CHANNELD_FUNDING_DEPTH.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2020-08-25 11:03:16 +09:30
parent 7804d89ef1
commit 8ae6740bb1
13 changed files with 434 additions and 439 deletions

View File

@@ -5,7 +5,7 @@
#include <ccan/crypto/ripemd160/ripemd160.h>
#include <ccan/mem/mem.h>
#include <ccan/tal/str/str.h>
#include <channeld/gen_channel_wire.h>
#include <channeld/channeld_wiregen.h>
#include <common/blinding.h>
#include <common/coin_mvt.h>
#include <common/ecdh.h>
@@ -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? */