db: clear our unneeded htlc fields in old terminated HTLCs.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2021-10-13 14:15:36 +10:30 committed by Christian Decker
parent 433e61fcb9
commit f986549cea
1 changed files with 8 additions and 0 deletions

View File

@ -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. */