mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-17 18:30:45 +00:00
Merge pull request #336 from gzliudan/fix-func-procFutureBlocks
Fix a loop closure bug in func procFutureBlocks
This commit is contained in:
commit
87ba815341
1 changed files with 2 additions and 1 deletions
|
|
@ -987,8 +987,9 @@ func (bc *BlockChain) procFutureBlocks() {
|
||||||
if i == len(blocks)-1 && err == nil {
|
if i == len(blocks)-1 && err == nil {
|
||||||
engine, ok := bc.Engine().(*XDPoS.XDPoS)
|
engine, ok := bc.Engine().(*XDPoS.XDPoS)
|
||||||
if ok {
|
if ok {
|
||||||
|
j := i
|
||||||
go func() {
|
go func() {
|
||||||
header := blocks[i].Header()
|
header := blocks[j].Header()
|
||||||
err = engine.HandleProposedBlock(bc, header)
|
err = engine.HandleProposedBlock(bc, header)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Info("[procFutureBlocks] handle proposed block has error", "err", err, "block hash", header.Hash(), "number", header.Number)
|
log.Info("[procFutureBlocks] handle proposed block has error", "err", err, "block hash", header.Hash(), "number", header.Number)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue