channel: only delete saved channels from database

There will be 'unsaved' channels now, with a dbid of 0
This commit is contained in:
niftynei 2021-01-19 18:21:45 -06:00 committed by Rusty Russell
parent 99123ddbe4
commit e15de71375

View File

@ -118,6 +118,7 @@ static void destroy_channel(struct channel *channel)
void delete_channel(struct channel *channel STEALS)
{
struct peer *peer = channel->peer;
if (channel->dbid != 0)
wallet_channel_close(channel->peer->ld->wallet, channel->dbid);
tal_free(channel);