From 71da6b5336b81b29a5d2a9a92e8a3f5cccb180e3 Mon Sep 17 00:00:00 2001 From: Keagan McClelland Date: Tue, 16 Jul 2024 15:47:14 -0700 Subject: [PATCH] lnwallet: consolidate redundant cases using Dual.ForParty --- lnwallet/channel.go | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/lnwallet/channel.go b/lnwallet/channel.go index 4b0ce1519..6b6799227 100644 --- a/lnwallet/channel.go +++ b/lnwallet/channel.go @@ -3067,19 +3067,10 @@ func (lc *LightningChannel) fetchParent(entry *paymentDescriptor, // The parent add height should never be zero at this point. If // that's the case we probably forgot to send a new commitment. - case whoseCommitChain.IsRemote() && - addEntry.addCommitHeights.Remote == 0: - + case addEntry.addCommitHeights.GetForParty(whoseCommitChain) == 0: return nil, fmt.Errorf("parent entry %d for update %d "+ - "had zero remote add height", entry.ParentIndex, - entry.LogIndex) - - case whoseCommitChain.IsLocal() && - addEntry.addCommitHeights.Local == 0: - - return nil, fmt.Errorf("parent entry %d for update %d "+ - "had zero local add height", entry.ParentIndex, - entry.LogIndex) + "had zero %v add height", entry.ParentIndex, + entry.LogIndex, whoseCommitChain) } return addEntry, nil