aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2015-05-30 07:21:09 +0800
committerFelix Lange <fjl@twurst.com>2015-05-30 07:21:09 +0800
commita906a84950f84a3cae178b2aca49fa6bba54a4c9 (patch)
tree68238da282ecfe4ae88a72f0c5c0000106d623bf
parent0e703d92ac9df61e2ededa8c895c70ded101a607 (diff)
parentb7fc85d68ea22a99222ba8535be8ff6410826644 (diff)
downloadgo-tangerine-a906a84950f84a3cae178b2aca49fa6bba54a4c9.tar
go-tangerine-a906a84950f84a3cae178b2aca49fa6bba54a4c9.tar.gz
go-tangerine-a906a84950f84a3cae178b2aca49fa6bba54a4c9.tar.bz2
go-tangerine-a906a84950f84a3cae178b2aca49fa6bba54a4c9.tar.lz
go-tangerine-a906a84950f84a3cae178b2aca49fa6bba54a4c9.tar.xz
go-tangerine-a906a84950f84a3cae178b2aca49fa6bba54a4c9.tar.zst
go-tangerine-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.go4
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)