Skip to content

Commit 195c979

Browse files
authored
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.
1 parent c40943a commit 195c979

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/bench_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ func genTxRing(naccounts int) func(int, *BlockGen) {
160160

161161
// genUncles generates blocks with two uncle headers.
162162
func genUncles(i int, gen *BlockGen) {
163-
if i >= 6 {
163+
if i >= 7 {
164164
b2 := gen.PrevBlock(i - 6).Header()
165165
b2.Extra = []byte("foo")
166166
gen.AddUncle(b2)

0 commit comments

Comments
 (0)