db: don't allow newer db versions.

Clearly we could do more damage if we continue.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2018-02-11 21:32:51 +10:30 committed by Christian Decker
parent 26617d1d64
commit 7eea02e846
1 changed files with 3 additions and 0 deletions

View File

@ -390,6 +390,9 @@ static void db_migrate(struct db *db, struct log *log)
if (current == -1)
log_info(log, "Creating database");
else if (available < current)
fatal("Refusing to migrate down from version %u to %u",
current, available);
else if (current != available)
log_info(log, "Updating database from version %u to %u",
current, available);