diff options
author | Péter Szilágyi <peterke@gmail.com> | 2015-05-30 04:46:10 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2015-05-30 04:46:10 +0800 |
commit | b7fc85d68ea22a99222ba8535be8ff6410826644 (patch) | |
tree | 83bb255d8903674cc429853d7e2c83e6510c03e7 | |
parent | 9f467c387a790242eb7cfa155e593a7df8dd82d0 (diff) | |
download | dexon-b7fc85d68ea22a99222ba8535be8ff6410826644.tar dexon-b7fc85d68ea22a99222ba8535be8ff6410826644.tar.gz dexon-b7fc85d68ea22a99222ba8535be8ff6410826644.tar.bz2 dexon-b7fc85d68ea22a99222ba8535be8ff6410826644.tar.lz dexon-b7fc85d68ea22a99222ba8535be8ff6410826644.tar.xz dexon-b7fc85d68ea22a99222ba8535be8ff6410826644.tar.zst dexon-b7fc85d68ea22a99222ba8535be8ff6410826644.zip |
core: fix #1154, sort out data race accessing the future blocks
-rw-r--r-- | core/chain_manager.go | 4 |
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) |