Merge pull request #336 from gzliudan/fix-func-procFutureBlocks

Fix a loop closure bug in func  procFutureBlocks
This commit is contained in:
Liam 2023-11-21 23:19:08 +11:00 committed by GitHub
commit 87ba815341
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -987,8 +987,9 @@ func (bc *BlockChain) procFutureBlocks() {
if i == len(blocks)-1 && err == nil {
engine, ok := bc.Engine().(*XDPoS.XDPoS)
if ok {
j := i
go func() {
header := blocks[i].Header()
header := blocks[j].Header()
err = engine.HandleProposedBlock(bc, header)
if err != nil {
log.Info("[procFutureBlocks] handle proposed block has error", "err", err, "block hash", header.Hash(), "number", header.Number)