aboutsummaryrefslogtreecommitdiff
path: root/examples/counter
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2019-10-21 16:07:47 -0400
committerDeterminant <[email protected]>2019-10-21 16:07:47 -0400
commit7212dbd90f4cb8fe907617f804c8940db1ce657e (patch)
treea80485085a7c30e2bb06cc64081a1effcffd2204 /examples/counter
parent79b1169a9ff0b54ddf3b520a70a79c78ba5c988d (diff)
fix the pool reset bug
Diffstat (limited to 'examples/counter')
-rw-r--r--examples/counter/main.go13
1 files changed, 5 insertions, 8 deletions
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
})