lightningd: delete all trace of nonexistent channels.

We're going to start loading them into memory for nicer responses if
people try to reestablish closed channels, but we don't care about ones
which were never actually opened.  We could add a new state, but easier
to simply remove them.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2025-04-29 09:54:33 +09:30
parent 98619a03f2
commit e8aac7e4a9
11 changed files with 80 additions and 27 deletions

View File

@@ -519,7 +519,7 @@ void channel_errmsg(struct channel *channel,
if (channel_state_uncommitted(channel->state)) {
log_info(channel->log, "%s", "Unsaved peer failed."
" Deleting channel.");
delete_channel(channel);
delete_channel(channel, false);
return;
}
@@ -3432,7 +3432,7 @@ static void process_dev_forget_channel(struct bitcoind *bitcoind UNUSED,
forget->channel->error = towire_errorfmt(forget->channel,
&forget->channel->cid,
"dev_forget_channel");
delete_channel(forget->channel);
delete_channel(forget->channel, false);
was_pending(command_success(forget->cmd, response));
}