[NOD-798] Disconnect from a peer if a block received from it gets rejected (#648)

* [NOD-798] Disconnect from a peer if its block gets rejected.

* [NOD-798] Make a comment less ambiguous.
This commit is contained in:
stasatdaglabs 2020-03-03 09:47:23 +02:00 committed by GitHub
parent 707a728656
commit a1c631be62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -512,6 +512,9 @@ func (sm *SyncManager) handleBlockMsg(bmsg *blockMsg) {
// send it.
code, reason := mempool.ErrToRejectErr(err)
peer.PushRejectMsg(wire.CmdBlock, code, reason, blockHash, false)
// Disconnect from the misbehaving peer.
peer.Disconnect()
return
}