From b2087a8a2efb1e658936ee4ab7dde6e476f888f6 Mon Sep 17 00:00:00 2001 From: ziggie Date: Sun, 20 Apr 2025 20:11:19 +0200 Subject: [PATCH] lnwallet: skip aux resolution call for non-anchor channels. --- lnwallet/channel.go | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/lnwallet/channel.go b/lnwallet/channel.go index 2c1e3a252..05cd23c32 100644 --- a/lnwallet/channel.go +++ b/lnwallet/channel.go @@ -7351,6 +7351,23 @@ func newOutgoingHtlcResolution(signer input.Signer, ControlBlock: ctrlBlock, } + // In case it is a legacy channel we return early as no aux resolution + // is neeeded. + if txSignDetails == nil { + return &OutgoingHtlcResolution{ + Expiry: htlc.RefundTimeout, + SignedTimeoutTx: timeoutTx, + SignDetails: txSignDetails, + CsvDelay: csvDelay, + ResolutionBlob: fn.None[tlv.Blob](), + ClaimOutpoint: wire.OutPoint{ + Hash: timeoutTx.TxHash(), + Index: 0, + }, + SweepSignDesc: sweepSignDesc, + }, nil + } + // This might be an aux channel, so we'll go ahead and attempt to // generate the resolution blob for the channel so we can pass along to // the sweeping sub-system. @@ -7694,6 +7711,20 @@ func newIncomingHtlcResolution(signer input.Signer, ControlBlock: ctrlBlock, } + if txSignDetails == nil { + return &IncomingHtlcResolution{ + SignedSuccessTx: successTx, + SignDetails: txSignDetails, + CsvDelay: csvDelay, + ResolutionBlob: fn.None[tlv.Blob](), + ClaimOutpoint: wire.OutPoint{ + Hash: successTx.TxHash(), + Index: 0, + }, + SweepSignDesc: sweepSignDesc, + }, nil + } + resolveRes := fn.MapOptionZ( auxResolver, func(a AuxContractResolver) fn.Result[tlv.Blob] { resReq := ResolutionReq{