mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 06:41:44 +01:00
peer: add flag to indicate whether we created anchor.
Useful for database. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
f4fe42e977
commit
ab2fac3714
2 changed files with 5 additions and 0 deletions
|
@ -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
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…
Add table
Reference in a new issue