|
|
@ -42,12 +42,10 @@ static Pkt *make_pkt(const tal_t *ctx, Pkt__PktCase type, const void *msg) |
|
|
|
Pkt *pkt_open(const tal_t *ctx, const struct peer *peer, |
|
|
|
OpenChannel__AnchorOffer anchor) |
|
|
|
{ |
|
|
|
struct sha256 revocation_hash; |
|
|
|
OpenChannel *o = tal(ctx, OpenChannel); |
|
|
|
|
|
|
|
open_channel__init(o); |
|
|
|
peer_get_revocation_hash(peer, 0, &revocation_hash); |
|
|
|
o->revocation_hash = sha256_to_proto(ctx, &revocation_hash); |
|
|
|
o->revocation_hash = sha256_to_proto(ctx, &peer->us.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); |
|
|
@ -184,7 +182,7 @@ Pkt *accept_pkt_open(const tal_t *ctx, |
|
|
|
if (!proto_to_pubkey(peer->dstate->secpctx, |
|
|
|
o->final_key, &peer->them.finalkey)) |
|
|
|
return pkt_err(ctx, "Bad finalkey"); |
|
|
|
proto_to_sha256(o->revocation_hash, &peer->their_rhash); |
|
|
|
proto_to_sha256(o->revocation_hash, &peer->them.revocation_hash); |
|
|
|
|
|
|
|
return NULL; |
|
|
|
} |
|
|
|