fix dv m2 validate block detail before broadcast

This commit is contained in:
Nguyen Ba Tam 2018-10-26 09:56:20 +07:00
parent 0365f6c2f5
commit d8cbcbd5d9

View file

@ -665,8 +665,8 @@ func (f *Fetcher) insert(peer string, block *types.Block) {
return return
} }
} }
go f.broadcastBlock(block, true)
if newBlock.Hash() == block.Hash() { if newBlock.Hash() == block.Hash() {
go f.broadcastBlock(block, true)
return return
} }
block = newBlock block = newBlock
@ -693,6 +693,7 @@ func (f *Fetcher) insert(peer string, block *types.Block) {
// If import succeeded, broadcast the block // If import succeeded, broadcast the block
propAnnounceOutTimer.UpdateSince(block.ReceivedAt) propAnnounceOutTimer.UpdateSince(block.ReceivedAt)
go f.broadcastBlock(block, true)
go f.broadcastBlock(block, false) go f.broadcastBlock(block, false)
}() }()