mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-02 04:34:20 +01:00
lightningd: clean up commando rune_counter from datastore on migration.
Pointed out by @ShahanaFarooqui, we leave a single unused entry in the datastore, so we should clean that up too. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -438,7 +438,7 @@ def test_commando_rune_migration(node_factory):
|
||||
l1.daemon.wait_for_logs(['Transferring commando rune to db: '] * 2)
|
||||
|
||||
# datastore should be empty:
|
||||
assert l1.rpc.listdatastore(['commando', 'runes']) == {'datastore': []}
|
||||
assert l1.rpc.listdatastore(['commando']) == {'datastore': []}
|
||||
|
||||
# Should match commando results!
|
||||
assert l1.rpc.showrunes() == {'runes': [{'rune':
|
||||
@@ -463,7 +463,7 @@ def test_commando_blacklist_migration(node_factory):
|
||||
l1.daemon.wait_for_logs(['Transferring commando blacklist to db: '] * 2)
|
||||
|
||||
# datastore should be empty:
|
||||
assert l1.rpc.listdatastore(['commando', 'blacklist']) == {'datastore': []}
|
||||
assert l1.rpc.listdatastore(['commando']) == {'datastore': []}
|
||||
|
||||
# Should match commando results!
|
||||
assert l1.rpc.blacklistrune() == {'blacklist': [{'start': 0, 'end': 6},
|
||||
|
||||
@@ -5722,4 +5722,10 @@ void migrate_datastore_commando_runes(struct lightningd *ld, struct db *db)
|
||||
db_insert_blacklist(db, &b);
|
||||
}
|
||||
db_datastore_remove(db, startkey);
|
||||
|
||||
/* Might as well clean up "rune_counter" while we're here, so
|
||||
* commando datastore is completely clean. */
|
||||
startkey[0] = "commando";
|
||||
startkey[1] = "rune_counter";
|
||||
db_datastore_remove(db, startkey);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user