Browse Source

db: migrate old shutdown_keyidx_local -1 values onto key 0.

It would be better to give them unique values, but we don't fully support
db migrate anyway and this is simple (though they will end up using the
same key for multiple channel closes if created before this commit).

Note that even if bip32_max_index is currently unset, it defaults to 0
so it will be found.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 7 years ago
committed by Christian Decker
parent
commit
f8c8d55565
  1. 3
      wallet/db.c

3
wallet/db.c

@ -230,6 +230,9 @@ char *dbmigrations[] = {
/* Necessary index for long rollbacks of the blockchain, otherwise we're
* doing table scans for every block removed. */
"CREATE INDEX utxoset_spend ON utxoset (spendheight)",
/* Assign key 0 to unassigned shutdown_keyidx_local. */
"UPDATE channels SET shutdown_keyidx_local=0 WHERE shutdown_keyidx_local = -1;",
/* FIXME: We should rename shutdown_keyidx_local to final_key_index */
NULL,
};

Loading…
Cancel
Save