Commit a906a849 authored by Felix Lange's avatar Felix Lange

Merge pull request #1155 from karalabe/fix-chainmanager-datarace

core: fix #1154, sort out data race accessing the future blocks
parents 0e703d92 b7fc85d6
...@@ -522,9 +522,9 @@ type queueEvent struct { ...@@ -522,9 +522,9 @@ type queueEvent struct {
} }
func (self *ChainManager) procFutureBlocks() { func (self *ChainManager) procFutureBlocks() {
blocks := make([]*types.Block, len(self.futureBlocks.blocks)) blocks := []*types.Block{}
self.futureBlocks.Each(func(i int, block *types.Block) { self.futureBlocks.Each(func(i int, block *types.Block) {
blocks[i] = block blocks = append(blocks, block)
}) })
types.BlockBy(types.Number).Sort(blocks) types.BlockBy(types.Number).Sort(blocks)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment