aboutsummaryrefslogtreecommitdiffstats
path: root/core/chain_makers_test.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-08-07 20:47:25 +0800
committerPéter Szilágyi <peterke@gmail.com>2017-08-07 21:00:47 +0800
commit2b50367fe938e603a5f9d3a525e0cdfa000f402e (patch)
treec032258a82131d9d3bacbe309682249c2430d6c9 /core/chain_makers_test.go
parent46cf0a616b597dfb8b1feff80ad58b6eb81e57d5 (diff)
downloaddexon-2b50367fe938e603a5f9d3a525e0cdfa000f402e.tar
dexon-2b50367fe938e603a5f9d3a525e0cdfa000f402e.tar.gz
dexon-2b50367fe938e603a5f9d3a525e0cdfa000f402e.tar.bz2
dexon-2b50367fe938e603a5f9d3a525e0cdfa000f402e.tar.lz
dexon-2b50367fe938e603a5f9d3a525e0cdfa000f402e.tar.xz
dexon-2b50367fe938e603a5f9d3a525e0cdfa000f402e.tar.zst
dexon-2b50367fe938e603a5f9d3a525e0cdfa000f402e.zip
core: fix blockchain goroutine leaks in tests
Diffstat (limited to 'core/chain_makers_test.go')
-rw-r--r--core/chain_makers_test.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/core/chain_makers_test.go b/core/chain_makers_test.go
index 3a7c62396..28eb76c63 100644
--- a/core/chain_makers_test.go
+++ b/core/chain_makers_test.go
@@ -81,7 +81,10 @@ func ExampleGenerateChain() {
// Import the chain. This runs all block validation rules.
evmux := &event.TypeMux{}
+
blockchain, _ := NewBlockChain(db, gspec.Config, ethash.NewFaker(), evmux, vm.Config{})
+ defer blockchain.Stop()
+
if i, err := blockchain.InsertChain(chain); err != nil {
fmt.Printf("insert error (block %d): %v\n", chain[i].NumberU64(), err)
return