diff options
author | Felix Lange <fjl@twurst.com> | 2015-05-30 07:21:09 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2015-05-30 07:21:09 +0800 |
commit | a906a84950f84a3cae178b2aca49fa6bba54a4c9 (patch) | |
tree | 68238da282ecfe4ae88a72f0c5c0000106d623bf | |
parent | 0e703d92ac9df61e2ededa8c895c70ded101a607 (diff) | |
parent | b7fc85d68ea22a99222ba8535be8ff6410826644 (diff) | |
download | dexon-a906a84950f84a3cae178b2aca49fa6bba54a4c9.tar dexon-a906a84950f84a3cae178b2aca49fa6bba54a4c9.tar.gz dexon-a906a84950f84a3cae178b2aca49fa6bba54a4c9.tar.bz2 dexon-a906a84950f84a3cae178b2aca49fa6bba54a4c9.tar.lz dexon-a906a84950f84a3cae178b2aca49fa6bba54a4c9.tar.xz dexon-a906a84950f84a3cae178b2aca49fa6bba54a4c9.tar.zst dexon-a906a84950f84a3cae178b2aca49fa6bba54a4c9.zip |
Merge pull request #1155 from karalabe/fix-chainmanager-datarace
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 3e8ef6fd8..088ca8d5b 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) |