diff --git a/core/blockchain_test.go b/core/blockchain_test.go index aba50c8627c96..fb9d55ed2cd05 100644 --- a/core/blockchain_test.go +++ b/core/blockchain_test.go @@ -681,7 +681,7 @@ func TestHeadersInsertNonceError(t *testing.T) { testInsertNonceError(t, false) func TestBlocksInsertNonceError(t *testing.T) { testInsertNonceError(t, true) } func testInsertNonceError(t *testing.T, full bool) { - for i := 1; i < 25 && !t.Failed(); i++ { + doTest := func(i int) { // Create a pristine chain and database genDb, _, blockchain, err := newCanonical(ethash.NewFaker(), 0, full) if err != nil { @@ -730,6 +730,9 @@ func testInsertNonceError(t *testing.T, full bool) { } } } + for i := 1; i < 25 && !t.Failed(); i++ { + doTest(i) + } } // Tests that fast importing a block chain produces the same chain data as the