aboutsummaryrefslogtreecommitdiff
path: root/src/p2p/net_node_common.h
diff options
context:
space:
mode:
authorJavier Smooth <iamjaviersmooth@gmail.com>2015-11-23 17:34:55 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2015-11-23 18:06:20 +0000
commit4cea2b13b221bed66023254dd3356f2548a08df4 (patch)
treefe379936ba2b09492cc9eb8b353e92b3fffeaacc /src/p2p/net_node_common.h
parentquiet down p2p logging a bit (diff)
downloadmonero-4cea2b13b221bed66023254dd3356f2548a08df4.tar.xz
Add IP blocking for misbehaving nodes (adapted from Boolberry)
With minor cleanup and fixes (spelling, indent) by moneromooo
Diffstat (limited to 'src/p2p/net_node_common.h')
-rw-r--r--src/p2p/net_node_common.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/p2p/net_node_common.h b/src/p2p/net_node_common.h
index a7b8bf6f3..93b29deb2 100644
--- a/src/p2p/net_node_common.h
+++ b/src/p2p/net_node_common.h
@@ -50,6 +50,8 @@ namespace nodetool
virtual void request_callback(const epee::net_utils::connection_context_base& context)=0;
virtual uint64_t get_connections_count()=0;
virtual void for_each_connection(std::function<bool(t_connection_context&, peerid_type)> f)=0;
+ virtual bool block_ip(uint32_t adress)=0;
+ virtual bool add_ip_fail(uint32_t adress)=0;
};
template<class t_connection_context>
@@ -84,5 +86,13 @@ namespace nodetool
{
return false;
}
+ virtual bool block_ip(uint32_t adress)
+ {
+ return true;
+ }
+ virtual bool add_ip_fail(uint32_t adress)
+ {
+ return true;
+ }
};
}