lnwallet: account for case where remote party has 2 unrevoked commits in DLP
This commit is contained in:
parent
fc8337b146
commit
4ff4e1b0de
@ -3501,7 +3501,16 @@ func (lc *LightningChannel) ProcessChanSyncMsg(
|
|||||||
// as that's what they should send.
|
// as that's what they should send.
|
||||||
case msg.NextLocalCommitHeight == remoteTailHeight+1:
|
case msg.NextLocalCommitHeight == remoteTailHeight+1:
|
||||||
commitPoint = lc.channelState.RemoteCurrentRevocation
|
commitPoint = lc.channelState.RemoteCurrentRevocation
|
||||||
|
|
||||||
|
// Alternatively, if their height is two beyond what we know their best
|
||||||
|
// height to be, then they're holding onto two commitments, and the
|
||||||
|
// highest unrevoked point it their next revocation.
|
||||||
|
//
|
||||||
|
// TODO(roasbeef): verify this in the spec...
|
||||||
|
case msg.NextLocalCommitHeight == remoteTailHeight+2:
|
||||||
|
commitPoint = lc.channelState.RemoteNextRevocation
|
||||||
}
|
}
|
||||||
|
|
||||||
if commitPoint != nil &&
|
if commitPoint != nil &&
|
||||||
!commitPoint.IsEqual(msg.LocalUnrevokedCommitPoint) {
|
!commitPoint.IsEqual(msg.LocalUnrevokedCommitPoint) {
|
||||||
|
|
||||||
@ -3513,6 +3522,7 @@ func (lc *LightningChannel) ProcessChanSyncMsg(
|
|||||||
if err := lc.channelState.MarkBorked(); err != nil {
|
if err := lc.channelState.MarkBorked(); err != nil {
|
||||||
return nil, nil, nil, err
|
return nil, nil, nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(halseth): force close?
|
// TODO(halseth): force close?
|
||||||
return nil, nil, nil, ErrInvalidLocalUnrevokedCommitPoint
|
return nil, nil, nil, ErrInvalidLocalUnrevokedCommitPoint
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user