diff --git a/lnwallet/aux_signer.go b/lnwallet/aux_signer.go index ef7133bd4..a2a4aa2e7 100644 --- a/lnwallet/aux_signer.go +++ b/lnwallet/aux_signer.go @@ -125,6 +125,10 @@ func NewAuxVerifyJob(sig fn.Option[tlv.Blob], keyRing CommitmentKeyRing, } } +// htlcCustomSigType is the TLV type that is used to encode the custom HTLC +// signatures within the custom data for an existing HTLC. +var htlcCustomSigType tlv.TlvType65543 + // AuxSigner is an interface that is used to sign and verify HTLCs for custom // channels. It is similar to the existing SigPool, but uses opaque blobs to // shuffle around signature information and other metadata. diff --git a/lnwallet/channel.go b/lnwallet/channel.go index a1ed2dc36..fc279c264 100644 --- a/lnwallet/channel.go +++ b/lnwallet/channel.go @@ -5496,6 +5496,14 @@ func genHtlcSigValidationJobs(chanState *channeldb.OpenChannel, localCommitmentView.customBlob, auxLeaf, ) + // As this HTLC has a custom sign associated with it, + // store in the custom records map so we can write to + // disk later. + sigType := htlcCustomSigType.TypeVal() + htlc.CustomRecords[uint64(sigType)] = auxSig.UnwrapOr( + nil, + ) + auxVerifyJobs = append(auxVerifyJobs, auxVerifyJob) }