lnwallet: consolidate redundant cases using Dual.ForParty

This commit is contained in:
Keagan McClelland committed 2024-10-11 11:12:36 +02:00
1 parent b457b40f80
commit 71da6b5336
1 file changed
+3 -12
+3 -12
View File
@@ -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