From 195c9791680428c80363893a35ce313888963499 Mon Sep 17 00:00:00 2001 From: rjl493456442 Date: Tue, 12 Apr 2022 16:34:07 +0800 Subject: [PATCH] core: fix benchmark panic (#24657) This PR fixes a few panics in the chain marker benchmarks. The root cause for panic is in chain marker the genesis header/block is not accessible, while it's expected to be obtained in tests. So this PR avoids touching genesis header at all to avoid panic. --- core/bench_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/bench_test.go b/core/bench_test.go index 7dd4839b4..3006e5513 100644 --- a/core/bench_test.go +++ b/core/bench_test.go @@ -160,7 +160,7 @@ func genTxRing(naccounts int) func(int, *BlockGen) { // genUncles generates blocks with two uncle headers. func genUncles(i int, gen *BlockGen) { - if i >= 6 { + if i >= 7 { b2 := gen.PrevBlock(i - 6).Header() b2.Extra = []byte("foo") gen.AddUncle(b2)