mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-23 17:14:22 +01:00
db: make db_set_visible_state called from within transaction.
We want to do this atomically; this is the first step. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
4
state.c
4
state.c
@@ -32,7 +32,9 @@ static Pkt *init_from_pkt_open(struct peer *peer, const Pkt *pkt)
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
if (!db_set_visible_state(peer))
|
||||
db_start_transaction(peer);
|
||||
db_set_visible_state(peer);
|
||||
if (db_commit_transaction(peer) != NULL)
|
||||
return pkt_err(peer, "Database error");
|
||||
|
||||
/* Set up their commit info now: rest gets done in setup_first_commit
|
||||
|
||||
Reference in New Issue
Block a user