From 0615c156f5c6d4482ec532ff84ad0afe5d9f7be9 Mon Sep 17 00:00:00 2001 From: Dusty Daemon Date: Thu, 1 May 2025 16:33:22 -0400 Subject: [PATCH] splice: Splice script should not abort on sign MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The result of splice_signed can fail for many reasons that are non-critical (already in mempool for instance). Don’t abort channels in this case as that causes a force close. --- plugins/spender/splice.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/plugins/spender/splice.c b/plugins/spender/splice.c index f6963e5e6..1c8ce72fa 100644 --- a/plugins/spender/splice.c +++ b/plugins/spender/splice.c @@ -730,6 +730,26 @@ static struct command_result *splice_signed_get_result(struct command *cmd, return continue_splice(splice_cmd->cmd, splice_cmd); } +static struct command_result *splice_signed_error_pkg(struct command *cmd, + const char *methodname, + const char *buf, + const jsmntok_t *error, + struct splice_index_pkg *pkg) +{ + struct splice_cmd *splice_cmd = pkg->splice_cmd; + struct abort_pkg *abort_pkg; + + splice_cmd->wetrun = false; + + abort_pkg = tal(cmd->plugin, struct abort_pkg); + abort_pkg->splice_cmd = tal_steal(abort_pkg, pkg->splice_cmd); + abort_pkg->str = tal_strndup(abort_pkg, buf + error->start, + error->end - error->start); + abort_pkg->code = -1; + + return make_error(cmd, abort_pkg, "splice_signed_error"); +} + static struct command_result *splice_signed(struct command *cmd, struct splice_cmd *splice_cmd, size_t index) @@ -743,7 +763,8 @@ static struct command_result *splice_signed(struct command *cmd, pkg->index = index; req = jsonrpc_request_start(cmd, "splice_signed", - splice_signed_get_result, splice_error_pkg, + splice_signed_get_result, + splice_signed_error_pkg, pkg); json_add_channel_id(req->js, "channel_id", action->channel_id);