mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-26 09:42:22 +00:00
stateroot: handle ErrStateMismatch internally
It's a local problem and returning error from here leads to peer disconnect that isn't solving anything.
This commit is contained in:
parent
216513e14f
commit
3b4dde05c3
1 changed files with 7 additions and 1 deletions
|
@ -9,6 +9,7 @@ import (
|
|||
"github.com/nspcc-dev/neo-go/pkg/core/block"
|
||||
"github.com/nspcc-dev/neo-go/pkg/core/blockchainer"
|
||||
"github.com/nspcc-dev/neo-go/pkg/core/state"
|
||||
"github.com/nspcc-dev/neo-go/pkg/core/stateroot"
|
||||
"github.com/nspcc-dev/neo-go/pkg/crypto/keys"
|
||||
"github.com/nspcc-dev/neo-go/pkg/io"
|
||||
"github.com/nspcc-dev/neo-go/pkg/network/payload"
|
||||
|
@ -107,7 +108,12 @@ func (s *service) OnPayload(ep *payload.Extensible) error {
|
|||
if sr.Index == 0 {
|
||||
return nil
|
||||
}
|
||||
return s.AddStateRoot(sr)
|
||||
err := s.AddStateRoot(sr)
|
||||
if errors.Is(err, stateroot.ErrStateMismatch) {
|
||||
s.log.Error("can't add SV-signed state root", zap.Error(err))
|
||||
return nil
|
||||
}
|
||||
return err
|
||||
case VoteT:
|
||||
v := m.Payload.(*Vote)
|
||||
return s.AddSignature(v.Height, v.ValidatorIndex, v.Signature)
|
||||
|
|
Loading…
Reference in a new issue