Skip to content

Commit f09d404

Browse files
authored
Merge pull request #8926 from lightningnetwork/second-level-aux
lnwallet: store aux sig in custom data within the HTLC
2 parents 90f997c + 6a8da1c commit f09d404

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ require (
4141
github.com/lightningnetwork/lnd/queue v1.1.1
4242
github.com/lightningnetwork/lnd/sqldb v1.0.2
4343
github.com/lightningnetwork/lnd/ticker v1.1.1
44-
github.com/lightningnetwork/lnd/tlv v1.2.5
44+
github.com/lightningnetwork/lnd/tlv v1.2.6
4545
github.com/lightningnetwork/lnd/tor v1.1.2
4646
github.com/ltcsuite/ltcd v0.0.0-20190101042124-f37f8bf35796
4747
github.com/miekg/dns v1.1.43

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -460,8 +460,8 @@ github.com/lightningnetwork/lnd/sqldb v1.0.2 h1:PfuYzScYMD9/QonKo/QvgsbXfTnH5Dfl
460460
github.com/lightningnetwork/lnd/sqldb v1.0.2/go.mod h1:V2Xl6JNWLTKE97WJnwfs0d0TYJdIQTqK8/3aAwkd3qI=
461461
github.com/lightningnetwork/lnd/ticker v1.1.1 h1:J/b6N2hibFtC7JLV77ULQp++QLtCwT6ijJlbdiZFbSM=
462462
github.com/lightningnetwork/lnd/ticker v1.1.1/go.mod h1:waPTRAAcwtu7Ji3+3k+u/xH5GHovTsCoSVpho0KDvdA=
463-
github.com/lightningnetwork/lnd/tlv v1.2.5 h1:/VsoWw628t78OiDN90pHDbqwOcuZ9JMicxXZVQjBwX0=
464-
github.com/lightningnetwork/lnd/tlv v1.2.5/go.mod h1:/CmY4VbItpOldksocmGT4lxiJqRP9oLxwSZOda2kzNQ=
463+
github.com/lightningnetwork/lnd/tlv v1.2.6 h1:icvQG2yDr6k3ZuZzfRdG3EJp6pHurcuh3R6dg0gv/Mw=
464+
github.com/lightningnetwork/lnd/tlv v1.2.6/go.mod h1:/CmY4VbItpOldksocmGT4lxiJqRP9oLxwSZOda2kzNQ=
465465
github.com/lightningnetwork/lnd/tor v1.1.2 h1:3zv9z/EivNFaMF89v3ciBjCS7kvCj4ZFG7XvD2Qq0/k=
466466
github.com/lightningnetwork/lnd/tor v1.1.2/go.mod h1:j7T9uJ2NLMaHwE7GiBGnpYLn4f7NRoTM6qj+ul6/ycA=
467467
github.com/ltcsuite/ltcd v0.0.0-20190101042124-f37f8bf35796 h1:sjOGyegMIhvgfq5oaue6Td+hxZuf3tDC8lAPrFldqFw=

lnwallet/aux_signer.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@ func NewAuxVerifyJob(sig fn.Option[tlv.Blob], keyRing CommitmentKeyRing,
125125
}
126126
}
127127

128+
// htlcCustomSigType is the TLV type that is used to encode the custom HTLC
129+
// signatures within the custom data for an existing HTLC.
130+
var htlcCustomSigType tlv.TlvType65543
131+
128132
// AuxSigner is an interface that is used to sign and verify HTLCs for custom
129133
// channels. It is similar to the existing SigPool, but uses opaque blobs to
130134
// shuffle around signature information and other metadata.

lnwallet/channel.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5496,6 +5496,14 @@ func genHtlcSigValidationJobs(chanState *channeldb.OpenChannel,
54965496
localCommitmentView.customBlob, auxLeaf,
54975497
)
54985498

5499+
// As this HTLC has a custom sign associated with it,
5500+
// store in the custom records map so we can write to
5501+
// disk later.
5502+
sigType := htlcCustomSigType.TypeVal()
5503+
htlc.CustomRecords[uint64(sigType)] = auxSig.UnwrapOr(
5504+
nil,
5505+
)
5506+
54995507
auxVerifyJobs = append(auxVerifyJobs, auxVerifyJob)
55005508
}
55015509

0 commit comments

Comments
 (0)