lnwallet: skip aux resolution call for non-anchor channels.

This commit is contained in:
ziggie
2025-04-20 20:11:19 +02:00
parent cb481df816
commit b2087a8a2e

View File

@@ -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{