network: fix stateroot processing for StateRootEnableIndex != 0

We we missing stateroot for StateRootEnableIndex, starting only with
StateRootEnableIndex + 1.
This commit is contained in:
Roman Khimov 2020-07-18 20:58:47 +03:00
parent 6d32751292
commit 692565c5a2

View file

@ -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 {