mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-21 14:24:09 +01:00
db: Add a cleanup migration to clear any dangling utxoset entries
Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
parent
eb531e6da7
commit
1133820ad6
1 changed files with 6 additions and 0 deletions
|
@ -270,6 +270,12 @@ char *dbmigrations[] = {
|
|||
/* Record the msatoshi actually sent in a payment. */
|
||||
"ALTER TABLE payments ADD msatoshi_sent INTEGER;",
|
||||
"UPDATE payments SET msatoshi_sent = msatoshi;",
|
||||
/* Delete dangling utxoset entries due to Issue #1280 */
|
||||
"DELETE FROM utxoset WHERE blockheight IN ("
|
||||
" SELECT DISTINCT(blockheight)"
|
||||
" FROM utxoset LEFT OUTER JOIN blocks on (blockheight == blocks.height) "
|
||||
" WHERE blocks.hash IS NULL"
|
||||
");",
|
||||
NULL,
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue