From fb80a5f905d78bd42d630f0732a62b63275ed69a Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 29 Mar 2017 21:22:15 +1030 Subject: [PATCH] Update wire from spec 06a5e6cbdbb4c6f8b8dab444de497cdb9c7d7f02 Only changes revoke_and_ack, which we don't implement yet anyway. Signed-off-by: Rusty Russell --- wire/gen_peer_wire_csv | 3 --- wire/test/run-peer-wire.c | 21 ++++++--------------- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/wire/gen_peer_wire_csv b/wire/gen_peer_wire_csv index 59ae8b6e3..04162ad6e 100644 --- a/wire/gen_peer_wire_csv +++ b/wire/gen_peer_wire_csv @@ -86,9 +86,6 @@ revoke_and_ack,133 revoke_and_ack,0,channel-id,32 revoke_and_ack,32,per-commitment-secret,32 revoke_and_ack,64,next-per-commitment-point,33 -revoke_and_ack,97,padding,1 -revoke_and_ack,98,num-htlc-timeouts,2 -revoke_and_ack,100,htlc-timeout-signature,num-htlc-timeouts*64 update_fee,134 update_fee,0,channel-id,32 update_fee,32,feerate-per-kw,4 diff --git a/wire/test/run-peer-wire.c b/wire/test/run-peer-wire.c index 47e4dae5f..a74ab6e9d 100644 --- a/wire/test/run-peer-wire.c +++ b/wire/test/run-peer-wire.c @@ -126,8 +126,6 @@ struct msg_revoke_and_ack { struct channel_id channel_id; struct sha256 per_commitment_secret; struct pubkey next_per_commitment_point; - u8 padding[1]; - secp256k1_ecdsa_signature *htlc_timeout_signature; }; struct msg_channel_update { secp256k1_ecdsa_signature signature; @@ -501,24 +499,20 @@ static struct msg_commit_sig *fromwire_struct_commit_sig(const tal_t *ctx, const static void *towire_struct_revoke_and_ack(const tal_t *ctx, const struct msg_revoke_and_ack *s) { - towire_pad_arr = s->padding; return towire_revoke_and_ack(ctx, &s->channel_id, &s->per_commitment_secret, - &s->next_per_commitment_point, - s->htlc_timeout_signature); + &s->next_per_commitment_point); } static struct msg_revoke_and_ack *fromwire_struct_revoke_and_ack(const tal_t *ctx, const void *p, size_t *plen) { struct msg_revoke_and_ack *s = tal(ctx, struct msg_revoke_and_ack); - fromwire_pad_arr = s->padding; - if (!fromwire_revoke_and_ack(s, p, plen, - &s->channel_id, - &s->per_commitment_secret, - &s->next_per_commitment_point, - &s->htlc_timeout_signature)) + if (!fromwire_revoke_and_ack(p, plen, + &s->channel_id, + &s->per_commitment_secret, + &s->next_per_commitment_point)) return tal_free(s); return s; @@ -780,8 +774,7 @@ static bool funding_created_eq(const struct msg_funding_created *a, static bool revoke_and_ack_eq(const struct msg_revoke_and_ack *a, const struct msg_revoke_and_ack *b) { - return eq_with(a, b, padding) - && eq_var(a, b, htlc_timeout_signature); + return structeq(a, b); } static bool open_channel_eq(const struct msg_open_channel *a, @@ -999,8 +992,6 @@ int main(void) memset(&raa, 2, sizeof(raa)); set_pubkey(&raa.next_per_commitment_point); - raa.htlc_timeout_signature = tal_arr(ctx, secp256k1_ecdsa_signature, 2); - memset(raa.htlc_timeout_signature, 2, sizeof(secp256k1_ecdsa_signature) * 2); msg = towire_struct_revoke_and_ack(ctx, &raa); len = tal_count(msg);