mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-01-10 07:08:05 -05:00
net: Mark peer as rejected if we have missing dispatchers for certain packets.
This commit is contained in:
@@ -293,6 +293,16 @@ impl Channel {
|
||||
// If we're getting messages without dispatchers, it's spam.
|
||||
Err(Error::MissingDispatcher) => {
|
||||
debug!(target: "net::channel::main_receive_loop()", "Stopping channel {:?}", self);
|
||||
|
||||
// We will reject further connections from this peer
|
||||
self.session
|
||||
.upgrade()
|
||||
.unwrap()
|
||||
.p2p()
|
||||
.hosts()
|
||||
.mark_rejected(self.address())
|
||||
.await;
|
||||
|
||||
return Err(Error::ChannelStopped)
|
||||
}
|
||||
Err(_) => unreachable!("You added a new error in notify()"),
|
||||
|
||||
Reference in New Issue
Block a user