diff --git a/pkg/core/blockchain.go b/pkg/core/blockchain.go index dd8416c35..f37e8441e 100644 --- a/pkg/core/blockchain.go +++ b/pkg/core/blockchain.go @@ -409,6 +409,9 @@ func (bc *Blockchain) persist(ctx context.Context) (err error) { } bc.blockCache.Delete(hash) persisted++ + } else { + // no next block in the cache, no reason to continue looping + break } } }