mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
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:
@@ -345,7 +345,15 @@ static struct command_result *listforwards_done(struct command *cmd,
|
||||
|
||||
req = del_request_start("delforward", cinfo, subsys);
|
||||
json_add_tok(req->js, "in_channel", inchan, buf);
|
||||
json_add_tok(req->js, "in_htlc_id", inid, buf);
|
||||
/* This can be missing if it was a forwards record from an old
|
||||
* closed channel in version <= 0.12.1. This is a special value
|
||||
* but we will delete them *all*, resulting in some failures! */
|
||||
#ifdef COMPAT_V0121
|
||||
if (!inid)
|
||||
json_add_u64(req->js, "in_htlc_id", -1ULL);
|
||||
else
|
||||
#endif
|
||||
json_add_tok(req->js, "in_htlc_id", inid, buf);
|
||||
json_add_tok(req->js, "status", status, buf);
|
||||
send_outreq(plugin, req);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user