mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-10-14 00:59:33 +00:00
[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:
parent
707a728656
commit
a1c631be62
@ -512,6 +512,9 @@ func (sm *SyncManager) handleBlockMsg(bmsg *blockMsg) {
|
|||||||
// send it.
|
// send it.
|
||||||
code, reason := mempool.ErrToRejectErr(err)
|
code, reason := mempool.ErrToRejectErr(err)
|
||||||
peer.PushRejectMsg(wire.CmdBlock, code, reason, blockHash, false)
|
peer.PushRejectMsg(wire.CmdBlock, code, reason, blockHash, false)
|
||||||
|
|
||||||
|
// Disconnect from the misbehaving peer.
|
||||||
|
peer.Disconnect()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user