diff --git a/pkg/consensus/consensus.go b/pkg/consensus/consensus.go index e685238fe..4971fd52d 100644 --- a/pkg/consensus/consensus.go +++ b/pkg/consensus/consensus.go @@ -349,6 +349,10 @@ func (s *service) getTx(h util.Uint256) block.Transaction { func (s *service) verifyBlock(b block.Block) bool { coreb := &b.(*neoBlock).Block + if s.Chain.BlockHeight() >= coreb.Index { + s.log.Warn("proposed block has already outdated") + return false + } maxBlockSize := int(s.Chain.GetMaxBlockSize()) size := io.GetVarSize(coreb) if size > maxBlockSize { @@ -379,6 +383,10 @@ func (s *service) verifyBlock(b block.Block) bool { zap.Error(err)) return false } + if s.Chain.BlockHeight() >= coreb.Index { + s.log.Warn("proposed block has already outdated") + return false + } } maxBlockSysFee := s.Chain.GetMaxBlockSystemFee()