Skip to content

Commit

Permalink
Merge pull request #610 from lochjin/dev1.2_p2p
Browse files Browse the repository at this point in the history
BUG:broadcast block error
  • Loading branch information
dindinw authored Feb 22, 2024
2 parents edad0ac + 8df1809 commit 37c6a98
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions p2p/synch/getblockdatas.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,11 +372,12 @@ func (s *Sync) broadcastBlockHandler(ctx context.Context, msg interface{}, strea
}
}
peid := pe.GetID()
_, _, err = s.p2p.BlockChain().ProcessBlock(block, blockchain.BFBroadcast, &peid)
if err != nil {
log.Error("Failed to process block", "hash", block.Hash(), "error", err)
return s.EncodeResponseMsg(stream, ret)
}
go func() {
_, _, err = s.p2p.BlockChain().ProcessBlock(block, blockchain.BFBroadcast, &peid)
if err != nil {
log.Error("Failed to process block", "hash", block.Hash(), "error", err)
}
}()
ret = 1
return s.EncodeResponseMsg(stream, ret)
}

0 comments on commit 37c6a98

Please sign in to comment.