mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-24 21:17:01 +01:00
lnwallet: consolidate redundant cases using Dual.ForParty
This commit is contained in:
@@ -3067,19 +3067,10 @@ func (lc *LightningChannel) fetchParent(entry *paymentDescriptor,
|
|||||||
|
|
||||||
// The parent add height should never be zero at this point. If
|
// The parent add height should never be zero at this point. If
|
||||||
// that's the case we probably forgot to send a new commitment.
|
// that's the case we probably forgot to send a new commitment.
|
||||||
case whoseCommitChain.IsRemote() &&
|
case addEntry.addCommitHeights.GetForParty(whoseCommitChain) == 0:
|
||||||
addEntry.addCommitHeights.Remote == 0:
|
|
||||||
|
|
||||||
return nil, fmt.Errorf("parent entry %d for update %d "+
|
return nil, fmt.Errorf("parent entry %d for update %d "+
|
||||||
"had zero remote add height", entry.ParentIndex,
|
"had zero %v add height", entry.ParentIndex,
|
||||||
entry.LogIndex)
|
entry.LogIndex, whoseCommitChain)
|
||||||
|
|
||||||
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)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return addEntry, nil
|
return addEntry, nil
|
||||||
|
|||||||
Reference in New Issue
Block a user