timers: wrap all calls in transactions.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2017-11-01 11:40:48 +10:30 committed by Christian Decker
parent 01361ab21b
commit 7586f3ed54
2 changed files with 13 additions and 1 deletions

View File

@ -309,8 +309,11 @@ int main(int argc, char *argv[])
if (v == ld)
break;
if (expired)
if (expired) {
db_begin_transaction(ld->wallet->db);
timer_expired(ld, expired);
db_commit_transaction(ld->wallet->db);
}
}
shutdown_subdaemons(ld);

View File

@ -7,9 +7,18 @@ int unused_main(int argc, char *argv[]);
/* Generated stub for crashlog_activate */
void crashlog_activate(const char *argv0 UNNEEDED, struct log *log UNNEEDED)
{ fprintf(stderr, "crashlog_activate called!\n"); abort(); }
/* Generated stub for db_begin_transaction */
bool db_begin_transaction(struct db *db UNNEEDED)
{ fprintf(stderr, "db_begin_transaction called!\n"); abort(); }
/* Generated stub for db_commit_transaction */
bool db_commit_transaction(struct db *db UNNEEDED)
{ fprintf(stderr, "db_commit_transaction called!\n"); abort(); }
/* Generated stub for debug_poll */
int debug_poll(struct pollfd *fds UNNEEDED, nfds_t nfds UNNEEDED, int timeout UNNEEDED)
{ fprintf(stderr, "debug_poll called!\n"); abort(); }
/* Generated stub for fatal */
void fatal(const char *fmt UNNEEDED, ...)
{ fprintf(stderr, "fatal called!\n"); abort(); }
/* Generated stub for gossip_init */
void gossip_init(struct lightningd *ld UNNEEDED)
{ fprintf(stderr, "gossip_init called!\n"); abort(); }