From b798df0c0699526c1c3844e24c73e1387dd5be73 Mon Sep 17 00:00:00 2001 From: Konstantin <355847+Frozen@users.noreply.github.com> Date: Sun, 17 Sep 2023 22:13:47 -0400 Subject: [PATCH] Fix for index. (#4504) --- core/blockchain_impl.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/blockchain_impl.go b/core/blockchain_impl.go index 965dccd9a..2c70d8044 100644 --- a/core/blockchain_impl.go +++ b/core/blockchain_impl.go @@ -1682,8 +1682,8 @@ func (bc *BlockChainImpl) buildLeaderRotationMeta(curHeader *block.Header) error return err } if curPubKey.Bytes != blockPubKey.Bytes || curHeader.Epoch().Uint64() != header.Epoch().Uint64() { - for j := i; i <= curHeader.NumberU64(); j++ { - header := bc.GetHeaderByNumber(i) + for j := i; j <= curHeader.NumberU64(); j++ { + header := bc.GetHeaderByNumber(j) if header == nil { return errors.New("header is nil") }