Browse Source

peer: add flag to indicate whether we created anchor.

Useful for database.

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

3
daemon/peer.h

@ -142,6 +142,9 @@ struct peer {
/* Depth to trigger anchor if still opening, or -1. */
int ok_depth;
/* Did we create anchor? */
bool ours;
} anchor;
struct {

2
state.c

@ -104,6 +104,7 @@ enum state state(struct peer *peer,
goto err_breakdown;
}
bitcoin_create_anchor(peer);
peer->anchor.ours = true;
/* This shouldn't happen! */
if (!setup_first_commit(peer)) {
@ -128,6 +129,7 @@ enum state state(struct peer *peer,
goto err_breakdown;
}
peer->anchor.ours = false;
if (!setup_first_commit(peer)) {
err = pkt_err(peer, "Insufficient funds for fee");
peer_open_complete(peer, err->error->problem);

Loading…
Cancel
Save