delforward: allow deletion of "unknown in_htlc_id" and fix autoclean to use it.

Note the caveats: we will delete *all* of them at once!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2022-09-27 09:13:36 +09:30
parent 6eac8dfe3c
commit 68f15f17bb
7 changed files with 74 additions and 22 deletions

View File

@@ -3010,8 +3010,14 @@ static struct command_result *json_delforward(struct command *cmd,
NULL))
return command_param_failed();
#ifdef COMPAT_V0121
/* Special value used if in_htlc_id is missing */
if (*htlc_id == HTLC_INVALID_ID)
htlc_id = NULL;
#endif
if (!wallet_forward_delete(cmd->ld->wallet,
chan_in, *htlc_id, *status))
chan_in, htlc_id, *status))
return command_fail(cmd, DELFORWARD_NOT_FOUND,
"Could not find that forward");