Skip to content

Commit 396e822

Browse files
cdeckerniftynei
authored andcommitted
db: Add a migration to set received_time on forwards in rare cases
The case where this is needed is when the wallet had a forwarded payment somewhere between commits 66a47d2 (which started tracking forwardings) and d901304 (which added the `received_time` column). This just emulates the behavior of sqlite3 for postgres as well. Signed-off-by: Christian Decker <@cdecker>
1 parent 1ecad0c commit 396e822

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

wallet/db.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,9 @@ static struct migration dbmigrations[] = {
477477
");"), NULL},
478478
{SQL("ALTER TABLE channels ADD shutdown_scriptpubkey_local BLOB;"),
479479
NULL},
480+
/* See https://github.com/ElementsProject/lightning/issues/3189 */
481+
{SQL("UPDATE forwarded_payments SET received_time=0 WHERE received_time IS NULL;"),
482+
NULL},
480483
};
481484

482485
/* Leak tracking. */

0 commit comments

Comments
 (0)