protocol: include next revocation hash in open packet.

This means we send the first two revocation hashes; this is important
once we move to a commit model as we need to send (unsolicited) the
signature for the *next* commit tx so we need its commit hash.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2016-03-15 17:08:35 +10:30
parent 53a8aef95c
commit b017ca1240
6 changed files with 28 additions and 4 deletions

View File

@@ -74,6 +74,7 @@ Pkt *pkt_open(const tal_t *ctx, const struct peer *peer,
open_channel__init(o);
o->revocation_hash = sha256_to_proto(ctx, &peer->us.revocation_hash);
o->next_revocation_hash = sha256_to_proto(ctx, &peer->us.next_revocation_hash);
o->commit_key = pubkey_to_proto(o, &peer->us.commitkey);
o->final_key = pubkey_to_proto(o, &peer->us.finalkey);
o->delay = tal(o, Locktime);
@@ -317,6 +318,7 @@ Pkt *accept_pkt_open(const tal_t *ctx,
o->final_key, &peer->them.finalkey))
return pkt_err(ctx, "Bad finalkey");
proto_to_sha256(o->revocation_hash, &peer->them.revocation_hash);
proto_to_sha256(o->next_revocation_hash, &peer->them.next_revocation_hash);
/* Redeemscript for anchor. */
peer->anchor.redeemscript