Browse Source

db: Make sure to enable foreign keys even after forking

This may be causing #1280, since with `--daemon` the DB is being reopened
without enabling the foreign key relations and hence the delete cascades.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
ppa-0.6.1
Christian Decker 7 years ago
parent
commit
eb531e6da7
  1. 1
      wallet/db.c

1
wallet/db.c

@ -522,6 +522,7 @@ void db_reopen_after_fork(struct db *db)
fatal("failed to re-open database %s: %s", db->filename,
sqlite3_errstr(err));
}
db_do_exec(__func__, db, "PRAGMA foreign_keys = ON;");
}
s64 db_get_intvar(struct db *db, char *varname, s64 defval)

Loading…
Cancel
Save