mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-22 14:22:37 +01:00
lnwallet: use fn.Set API directly instead of empty struct map.
This commit is contained in:
parent
d82d02831d
commit
b902d0825d
1 changed files with 6 additions and 6 deletions
|
@ -2911,8 +2911,8 @@ func (lc *LightningChannel) evaluateHTLCView(view *HtlcView, ourBalance,
|
|||
// keep track of which entries we need to skip when creating the final
|
||||
// htlc view. We skip an entry whenever we find a settle or a timeout
|
||||
// modifying an entry.
|
||||
skipUs := make(map[uint64]struct{})
|
||||
skipThem := make(map[uint64]struct{})
|
||||
skipUs := fn.NewSet[uint64]()
|
||||
skipThem := fn.NewSet[uint64]()
|
||||
|
||||
// First we run through non-add entries in both logs, populating the
|
||||
// skip sets.
|
||||
|
@ -2947,7 +2947,7 @@ func (lc *LightningChannel) evaluateHTLCView(view *HtlcView, ourBalance,
|
|||
return nil, lntypes.Dual[[]*paymentDescriptor]{}, err
|
||||
}
|
||||
|
||||
skipThem[addEntry.HtlcIndex] = struct{}{}
|
||||
skipThem.Add(addEntry.HtlcIndex)
|
||||
|
||||
rmvHeight := entry.removeCommitHeights.GetForParty(
|
||||
whoseCommitChain,
|
||||
|
@ -2991,7 +2991,7 @@ func (lc *LightningChannel) evaluateHTLCView(view *HtlcView, ourBalance,
|
|||
return nil, lntypes.Dual[[]*paymentDescriptor]{}, err
|
||||
}
|
||||
|
||||
skipUs[addEntry.HtlcIndex] = struct{}{}
|
||||
skipUs.Add(addEntry.HtlcIndex)
|
||||
|
||||
rmvHeight := entry.removeCommitHeights.GetForParty(
|
||||
whoseCommitChain,
|
||||
|
@ -3008,7 +3008,7 @@ func (lc *LightningChannel) evaluateHTLCView(view *HtlcView, ourBalance,
|
|||
// added HTLCs.
|
||||
for _, entry := range view.OurUpdates {
|
||||
isAdd := entry.EntryType == Add
|
||||
if _, ok := skipUs[entry.HtlcIndex]; !isAdd || ok {
|
||||
if skipUs.Contains(entry.HtlcIndex) || !isAdd {
|
||||
continue
|
||||
}
|
||||
|
||||
|
@ -3029,7 +3029,7 @@ func (lc *LightningChannel) evaluateHTLCView(view *HtlcView, ourBalance,
|
|||
// Again, we do the same for our peer's updates.
|
||||
for _, entry := range view.TheirUpdates {
|
||||
isAdd := entry.EntryType == Add
|
||||
if _, ok := skipThem[entry.HtlcIndex]; !isAdd || ok {
|
||||
if skipThem.Contains(entry.HtlcIndex) || !isAdd {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue