wallet: remove obsolete peers.

Fixes: #1029
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2018-02-22 11:59:08 +10:30
committed by Christian Decker
parent ae7d857c44
commit 655ae90e5e

View File

@@ -196,6 +196,8 @@ char *dbmigrations[] = {
"DELETE FROM channels WHERE state=1",
/* Keep track of db ugprades, for debugging */
"CREATE TABLE db_upgrades (upgrade_from INTEGER, lightning_version TEXT);",
/* We used not to clean up peers when their channels were gone. */
"DELETE FROM peers WHERE id NOT IN (SELECT peer_id FROM channels);",
NULL,
};