Browse Source

daemon/peer: save their commit key too.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 9 years ago
parent
commit
d303393d67
  1. 3
      daemon/peer.h
  2. 4
      daemon/secrets.c

3
daemon/peer.h

@ -28,7 +28,8 @@ struct peer {
struct log *log; struct log *log;
/* Keys for transactions with this peer. */ /* 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; struct peer_secrets *secrets;
}; };

4
daemon/secrets.c

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

Loading…
Cancel
Save