paych: strict nonce check when expecteing nonzero delta

This commit is contained in:
Łukasz Magiera 2019-09-25 15:25:54 +02:00
parent 14465c7e30
commit 0299fa48f0

View File

@ -262,7 +262,7 @@ func (pm *Manager) AddVoucher(ctx context.Context, ch address.Address, sv *types
return types.NewInt(0), xerrors.New("lane closed")
}
if laneState.Nonce > sv.Nonce {
if minDelta.GreaterThan(types.NewInt(0)) && laneState.Nonce > sv.Nonce {
return types.NewInt(0), xerrors.Errorf("already storing voucher with higher nonce; %d > %d", laneState.Nonce, sv.Nonce)
}