lnwallet: pack paymentDescriptor add/remove heights into Duals

The purpose of this commit is to begin the process of packing
symmetric fields into the newly introduced Dual structure. The
reason for this is that the Dual structure has a handy indexing
method where we can supply a ChannelParty and get back a value.
This will cut down on the amount of branching code in the main
lines of the codebase logic, making it easier to follow what is
going on.
This commit is contained in:
Keagan McClelland
2024-07-16 15:35:58 -07:00
parent 0dd58ee529
commit b457b40f80
5 changed files with 301 additions and 224 deletions

View File

@@ -109,10 +109,10 @@ func newAuxHtlcDescriptor(p *paymentDescriptor) AuxHtlcDescriptor {
ParentIndex: p.ParentIndex,
EntryType: p.EntryType,
CustomRecords: p.CustomRecords.Copy(),
addCommitHeightRemote: p.addCommitHeightRemote,
addCommitHeightLocal: p.addCommitHeightLocal,
removeCommitHeightRemote: p.removeCommitHeightRemote,
removeCommitHeightLocal: p.removeCommitHeightLocal,
addCommitHeightRemote: p.addCommitHeights.Remote,
addCommitHeightLocal: p.addCommitHeights.Local,
removeCommitHeightRemote: p.removeCommitHeights.Remote,
removeCommitHeightLocal: p.removeCommitHeights.Local,
}
}