Browse Source

peer: save minimum possible depth for anchor.

We'll save this in the database so we know where to start the chain
from when we reload.

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

1
daemon/peer.c

@ -2001,6 +2001,7 @@ static struct peer *new_peer(struct lightningd_state *dstate,
peer->local.commit = peer->remote.commit = NULL; peer->local.commit = peer->remote.commit = NULL;
peer->local.staging_cstate = peer->remote.staging_cstate = NULL; peer->local.staging_cstate = peer->remote.staging_cstate = NULL;
peer->anchor.min_depth = get_block_height(peer->dstate);
htlc_map_init(&peer->htlcs); htlc_map_init(&peer->htlcs);
/* FIXME: Attach IO logging for this peer. */ /* FIXME: Attach IO logging for this peer. */

3
daemon/peer.h

@ -131,6 +131,9 @@ struct peer {
u64 satoshis; u64 satoshis;
u8 *witnessscript; u8 *witnessscript;
/* Minimum possible depth for anchor */
unsigned int min_depth;
/* If we're creating anchor, this tells us where to source it */ /* If we're creating anchor, this tells us where to source it */
struct anchor_input *input; struct anchor_input *input;

Loading…
Cancel
Save