From 692565c5a28ca213a6c59863a667f53f3a2543d5 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Sat, 18 Jul 2020 20:58:47 +0300 Subject: [PATCH] network: fix stateroot processing for StateRootEnableIndex != 0 We we missing stateroot for StateRootEnableIndex, starting only with StateRootEnableIndex + 1. --- pkg/network/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/network/server.go b/pkg/network/server.go index 690e92b31..aadc7d6d0 100644 --- a/pkg/network/server.go +++ b/pkg/network/server.go @@ -630,7 +630,7 @@ func (s *Server) handleRootsCmd(p Peer, rs *payload.StateRoots) error { } h := s.chain.StateHeight() if h < s.chain.GetConfig().StateRootEnableIndex { - h = s.chain.GetConfig().StateRootEnableIndex + h = s.chain.GetConfig().StateRootEnableIndex - 1 } for i := range rs.Roots { if rs.Roots[i].Index <= h {