punish by node id

This commit is contained in:
Christien Rioux
2023-07-15 19:32:53 -04:00
parent 80cb23c0c6
commit 3264b568d0
15 changed files with 202 additions and 64 deletions

View File

@@ -410,7 +410,7 @@ impl Network {
if self
.network_manager()
.address_filter()
.is_punished(dial_info.address().to_ip_addr())
.is_ip_addr_punished(dial_info.address().to_ip_addr())
{
return Ok(NetworkResult::no_connection_other("punished"));
}
@@ -477,7 +477,7 @@ impl Network {
if self
.network_manager()
.address_filter()
.is_punished(dial_info.address().to_ip_addr())
.is_ip_addr_punished(dial_info.address().to_ip_addr())
{
return Ok(NetworkResult::no_connection_other("punished"));
}

View File

@@ -120,7 +120,7 @@ impl Network {
};
// Check to see if it is punished
let address_filter = self.network_manager().address_filter();
if address_filter.is_punished(peer_addr.ip()) {
if address_filter.is_ip_addr_punished(peer_addr.ip()) {
return;
}

View File

@@ -24,7 +24,7 @@ impl ProtocolNetworkConnection {
timeout_ms: u32,
address_filter: AddressFilter,
) -> io::Result<NetworkResult<ProtocolNetworkConnection>> {
if address_filter.is_punished(dial_info.address().to_ip_addr()) {
if address_filter.is_ip_addr_punished(dial_info.address().to_ip_addr()) {
return Ok(NetworkResult::no_connection_other("punished"));
}
match dial_info.protocol_type() {

View File

@@ -25,7 +25,7 @@ impl RawUdpProtocolHandler {
// Check to see if it is punished
if let Some(af) = self.address_filter.as_ref() {
if af.is_punished(remote_addr.ip()) {
if af.is_ip_addr_punished(remote_addr.ip()) {
continue;
}
}
@@ -97,7 +97,7 @@ impl RawUdpProtocolHandler {
// Check to see if it is punished
if let Some(af) = self.address_filter.as_ref() {
if af.is_punished(remote_addr.ip()) {
if af.is_ip_addr_punished(remote_addr.ip()) {
return Ok(NetworkResult::no_connection_other("punished"));
}
}