From d60e9f342b4cee65fb4bc3b96f397b0dd4ac8b84 Mon Sep 17 00:00:00 2001 From: Dusty Daemon Date: Mon, 11 Nov 2024 11:42:53 +1030 Subject: [PATCH] splice: Extract remote sig from psbt if needed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On certain well timed restarts we lose their siganture from memory and don’t receive it from them. In these cases we can extract it from the PSBT directly. --- channeld/channeld.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/channeld/channeld.c b/channeld/channeld.c index 51c7b8ded..9c637d5d8 100644 --- a/channeld/channeld.c +++ b/channeld/channeld.c @@ -3420,10 +3420,17 @@ static void resume_splice_negotiation(struct peer *peer, && have_they_signed_inflight(peer, inflight)) { if (!their_sig) { - status_failed(STATUS_FAIL_INTERNAL_ERROR, - "Should not arrive here w/o their_sig"); - return; + status_debug("Splice: Extracting their_sig from psbt"); + if (!psbt_input_get_signature(tmpctx, current_psbt, + splice_funding_index, + &peer->channel->funding_pubkey[REMOTE], + &their_sig)) + status_failed(STATUS_FAIL_INTERNAL_ERROR, + "Should not arrive here w/o" + " their_sig"); } + assert(their_sig); + psbt_input_set_witscript(current_psbt, splice_funding_index, wit_script);