From f986549cea921e26952b6576f3dc22555b2f2dab Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 13 Oct 2021 14:15:36 +1030 Subject: [PATCH] db: clear our unneeded htlc fields in old terminated HTLCs. Signed-off-by: Rusty Russell --- wallet/db.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/wallet/db.c b/wallet/db.c index 54f78bbdd..248bc9deb 100644 --- a/wallet/db.c +++ b/wallet/db.c @@ -844,6 +844,14 @@ static struct migration dbmigrations[] = { " (SELECT GREATEST(next_index_local, next_index_remote)" " FROM channels WHERE id=channel_id)" " WHERE (hstate=9 OR hstate=19);"), NULL}, + /* Remove unused fields which take much room in db. */ + {SQL("UPDATE channel_htlcs SET" + " payment_key=NULL," + " routing_onion=NULL," + " failuremsg=NULL," + " shared_secret=NULL," + " localfailmsg=NULL" + " WHERE (hstate=9 OR hstate=19);"), NULL}, }; /* Leak tracking. */