From 7212dbd90f4cb8fe907617f804c8940db1ce657e Mon Sep 17 00:00:00 2001 From: Determinant Date: Mon, 21 Oct 2019 16:07:47 -0400 Subject: fix the pool reset bug --- examples/counter/main.go | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'examples/counter/main.go') diff --git a/examples/counter/main.go b/examples/counter/main.go index 5ec83fc..e802a33 100644 --- a/examples/counter/main.go +++ b/examples/counter/main.go @@ -141,14 +141,11 @@ func main() { header.Extra = append(header.Extra, hid...) }) chain.SetOnSealFinish(func(block *types.Block) error { - go func() { - // generate 15 blocks - blockCount++ - if postGen(block) { - return - } - chain.GenBlock() - }() + blockCount++ + if postGen(block) { + return nil + } + chain.GenBlock() return nil }) -- cgit v1.2.3