From e45bc0ce4744858ecefa5cc6f9ea1e18ff796fbd Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 29 Mar 2017 21:23:15 +1030 Subject: [PATCH] Update wire from spec 9a572ff0a3a4d6bceba9c0a9b859692180ecf18f Only changes commit_sig to commitment_signed, which we don't implement yet anyway. Signed-off-by: Rusty Russell --- lightningd/gossip/gossip.c | 2 +- wire/gen_peer_wire_csv | 10 +++++----- wire/test/run-peer-wire.c | 34 +++++++++++++++++----------------- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/lightningd/gossip/gossip.c b/lightningd/gossip/gossip.c index 8b8433621..736a9360c 100644 --- a/lightningd/gossip/gossip.c +++ b/lightningd/gossip/gossip.c @@ -200,7 +200,7 @@ static struct io_plan *peer_msgin(struct io_conn *conn, case WIRE_UPDATE_FULFILL_HTLC: case WIRE_UPDATE_FAIL_HTLC: case WIRE_UPDATE_FAIL_MALFORMED_HTLC: - case WIRE_COMMIT_SIG: + case WIRE_COMMITMENT_SIGNED: case WIRE_REVOKE_AND_ACK: /* Not our place to handle this, so we punt */ s = towire_gossipstatus_peer_nongossip(msg, peer->unique_id, diff --git a/wire/gen_peer_wire_csv b/wire/gen_peer_wire_csv index 04162ad6e..0e5d43eae 100644 --- a/wire/gen_peer_wire_csv +++ b/wire/gen_peer_wire_csv @@ -77,11 +77,11 @@ update_fail_malformed_htlc,0,channel-id,32 update_fail_malformed_htlc,32,id,8 update_fail_malformed_htlc,40,sha256-of-onion,32 update_fail_malformed_htlc,72,failure-code,2 -commit_sig,132 -commit_sig,0,channel-id,32 -commit_sig,32,signature,64 -commit_sig,96,num-htlcs,2 -commit_sig,98,htlc-signature,num-htlcs*64 +commitment_signed,132 +commitment_signed,0,channel-id,32 +commitment_signed,32,signature,64 +commitment_signed,96,num-htlcs,2 +commitment_signed,98,htlc-signature,num-htlcs*64 revoke_and_ack,133 revoke_and_ack,0,channel-id,32 revoke_and_ack,32,per-commitment-secret,32 diff --git a/wire/test/run-peer-wire.c b/wire/test/run-peer-wire.c index a74ab6e9d..7fe15cab9 100644 --- a/wire/test/run-peer-wire.c +++ b/wire/test/run-peer-wire.c @@ -147,7 +147,7 @@ struct msg_announcement_signatures { secp256k1_ecdsa_signature announcement_node_signature; secp256k1_ecdsa_signature announcement_bitcoin_signature; }; -struct msg_commit_sig { +struct msg_commitment_signed { struct channel_id channel_id; secp256k1_ecdsa_signature signature; secp256k1_ecdsa_signature *htlc_signature; @@ -475,20 +475,20 @@ static struct msg_update_fulfill_htlc *fromwire_struct_update_fulfill_htlc(const return tal_free(s); } -static void *towire_struct_commit_sig(const tal_t *ctx, - const struct msg_commit_sig *s) +static void *towire_struct_commitment_signed(const tal_t *ctx, + const struct msg_commitment_signed *s) { - return towire_commit_sig(ctx, - &s->channel_id, - &s->signature, - s->htlc_signature); + return towire_commitment_signed(ctx, + &s->channel_id, + &s->signature, + s->htlc_signature); } -static struct msg_commit_sig *fromwire_struct_commit_sig(const tal_t *ctx, const void *p, size_t *plen) +static struct msg_commitment_signed *fromwire_struct_commitment_signed(const tal_t *ctx, const void *p, size_t *plen) { - struct msg_commit_sig *s = tal(ctx, struct msg_commit_sig); + struct msg_commitment_signed *s = tal(ctx, struct msg_commitment_signed); - if (!fromwire_commit_sig(s, p, plen, + if (!fromwire_commitment_signed(s, p, plen, &s->channel_id, &s->signature, &s->htlc_signature)) @@ -712,8 +712,8 @@ static bool update_fail_htlc_eq(const struct msg_update_fail_htlc *a, && eq_var(a, b, reason); } -static bool commit_sig_eq(const struct msg_commit_sig *a, - const struct msg_commit_sig *b) +static bool commitment_signed_eq(const struct msg_commitment_signed *a, + const struct msg_commitment_signed *b) { return eq_upto(a, b, htlc_signature) && eq_var(a, b, htlc_signature); @@ -832,7 +832,7 @@ int main(void) struct msg_funding_locked fl, *fl2; struct msg_announcement_signatures as, *as2; struct msg_update_fail_htlc ufh, *ufh2; - struct msg_commit_sig cs, *cs2; + struct msg_commitment_signed cs, *cs2; struct msg_funding_signed fs, *fs2; struct msg_closing_signed cls, *cls2; struct msg_update_fulfill_htlc uflh, *uflh2; @@ -903,12 +903,12 @@ int main(void) cs.htlc_signature = tal_arr(ctx, secp256k1_ecdsa_signature, 2); memset(cs.htlc_signature, 2, sizeof(secp256k1_ecdsa_signature)*2); - msg = towire_struct_commit_sig(ctx, &cs); + msg = towire_struct_commitment_signed(ctx, &cs); len = tal_count(msg); - cs2 = fromwire_struct_commit_sig(ctx, msg, &len); + cs2 = fromwire_struct_commitment_signed(ctx, msg, &len); assert(len == 0); - assert(commit_sig_eq(&cs, cs2)); - test_corruption(&cs, cs2, commit_sig); + assert(commitment_signed_eq(&cs, cs2)); + test_corruption(&cs, cs2, commitment_signed); memset(&fs, 2, sizeof(fs));