aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2015-05-30 04:46:10 +0800
committerPéter Szilágyi <peterke@gmail.com>2015-05-30 04:46:10 +0800
commitb7fc85d68ea22a99222ba8535be8ff6410826644 (patch)
tree83bb255d8903674cc429853d7e2c83e6510c03e7 /core
parent9f467c387a790242eb7cfa155e593a7df8dd82d0 (diff)
downloaddexon-b7fc85d68ea22a99222ba8535be8ff6410826644.tar.gz
dexon-b7fc85d68ea22a99222ba8535be8ff6410826644.tar.zst
dexon-b7fc85d68ea22a99222ba8535be8ff6410826644.zip
core: fix #1154, sort out data race accessing the future blocks
Diffstat (limited to 'core')
-rw-r--r--core/chain_manager.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/chain_manager.go b/core/chain_manager.go
index edf8825f3..3408b5030 100644
--- a/core/chain_manager.go
+++ b/core/chain_manager.go
@@ -522,9 +522,9 @@ type queueEvent struct {
}
func (self *ChainManager) procFutureBlocks() {
- blocks := make([]*types.Block, len(self.futureBlocks.blocks))
+ blocks := []*types.Block{}
self.futureBlocks.Each(func(i int, block *types.Block) {
- blocks[i] = block
+ blocks = append(blocks, block)
})
types.BlockBy(types.Number).Sort(blocks)