punish by node id
This commit is contained in:
@@ -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"));
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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"));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user