mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-03 22:34:21 +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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user