daemon/peer: save their commit key too.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2016-01-22 06:41:49 +10:30
parent a5aa7b9abd
commit d303393d67
2 changed files with 4 additions and 3 deletions

View File

@ -28,7 +28,8 @@ struct peer {
struct log *log;
/* Keys for transactions with this peer. */
struct pubkey commitkey, finalkey;
struct pubkey their_commitkey, their_finalkey;
struct pubkey our_commitkey, our_finalkey;
struct peer_secrets *secrets;
};

View File

@ -55,8 +55,8 @@ void peer_secrets_init(struct peer *peer)
{
peer->secrets = tal(peer, struct peer_secrets);
new_keypair(peer->state, &peer->secrets->commit, &peer->commitkey);
new_keypair(peer->state, &peer->secrets->final, &peer->finalkey);
new_keypair(peer->state, &peer->secrets->commit, &peer->our_commitkey);
new_keypair(peer->state, &peer->secrets->final, &peer->our_finalkey);
if (RAND_bytes(peer->secrets->revocation_seed.u.u8,
sizeof(peer->secrets->revocation_seed.u.u8)) != 1)
fatal("Could not get random bytes for revocation seed");