Browse Source

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>
travis-debug
Christian Decker 5 years ago
committed by neil saitug
parent
commit
396e8224fa
  1. 3
      wallet/db.c

3
wallet/db.c

@ -477,6 +477,9 @@ static struct migration dbmigrations[] = {
");"), NULL},
{SQL("ALTER TABLE channels ADD shutdown_scriptpubkey_local BLOB;"),
NULL},
/* See https://github.com/ElementsProject/lightning/issues/3189 */
{SQL("UPDATE forwarded_payments SET received_time=0 WHERE received_time IS NULL;"),
NULL},
};
/* Leak tracking. */

Loading…
Cancel
Save