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

core: fix #1154, sort out data race accessing the future blocks
pull/1161/head
Felix Lange 10 years ago
commit a906a84950
  1. 4
      core/chain_manager.go

@ -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)

Loading…
Cancel
Save