Skip to content

Commit b199e9b

Browse files
Roasbeefguggero
authored andcommitted
lnwallet: add incoming+outgoing aux leaves to CommitAuxLeaves
In addition to the leaves for the commitment outputs, we'll also need to interact with leaves for all the HTLC outputs as well.
1 parent 6d831ea commit b199e9b

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

lnwallet/commitment.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -627,14 +627,24 @@ type CommitAuxLeaves struct {
627627

628628
// RemoteAuxLeaf is the remote party's auxiliary leaf.
629629
RemoteAuxLeaf input.AuxTapLeaf
630+
631+
// OutgoingHTLCLeaves is the set of aux leaves for the outgoing HTLCs
632+
// on this commitment transaction.
633+
OutgoingHtlcLeaves input.AuxTapLeaves
634+
635+
// IncomingHTLCLeaves is the set of aux leaves for the incoming HTLCs
636+
// on this commitment transaction.
637+
IncomingHtlcLeaves input.AuxTapLeaves
630638
}
631639

632640
// ForRemoteCommit returns the local+remote aux leaves from the PoV of the
633641
// remote party's commitment.
634642
func (c *CommitAuxLeaves) ForRemoteCommit() CommitAuxLeaves {
635643
return CommitAuxLeaves{
636-
LocalAuxLeaf: c.RemoteAuxLeaf,
637-
RemoteAuxLeaf: c.LocalAuxLeaf,
644+
LocalAuxLeaf: c.RemoteAuxLeaf,
645+
RemoteAuxLeaf: c.LocalAuxLeaf,
646+
OutgoingHtlcLeaves: c.IncomingHtlcLeaves,
647+
IncomingHtlcLeaves: c.OutgoingHtlcLeaves,
638648
}
639649
}
640650

0 commit comments

Comments
 (0)