aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_protocol/cryptonote_protocol_handler.h
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2020-12-07 10:04:08 -0600
committerluigi1111 <luigi1111w@gmail.com>2020-12-07 10:04:08 -0600
commit6d35b667cf2891fcd0ab228d01b13ec9be7cb50d (patch)
tree14f6c5bfcc6ce9635afd88812e0f369531cbb70a /src/cryptonote_protocol/cryptonote_protocol_handler.h
parentMerge pull request #7059 (diff)
parentprotocol: drop peers that don't reply to queries (diff)
downloadmonero-6d35b667cf2891fcd0ab228d01b13ec9be7cb50d.tar.xz
Merge pull request #7054
ce26c5b protocol: drop peers that don't reply to queries (moneromooo) 9427b5a keep only the last seen node on a given host in the white list (moneromooo) fa79148 protocol: drop peers that decrease claimed height (moneromooo) 1382b17 protocol: add scoring system to drop peers that don't behave (moneromooo)
Diffstat (limited to 'src/cryptonote_protocol/cryptonote_protocol_handler.h')
-rw-r--r--src/cryptonote_protocol/cryptonote_protocol_handler.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/cryptonote_protocol/cryptonote_protocol_handler.h b/src/cryptonote_protocol/cryptonote_protocol_handler.h
index 61aac6d81..ee3a67198 100644
--- a/src/cryptonote_protocol/cryptonote_protocol_handler.h
+++ b/src/cryptonote_protocol/cryptonote_protocol_handler.h
@@ -148,6 +148,7 @@ namespace cryptonote
void notify_new_stripe(cryptonote_connection_context &context, uint32_t stripe);
void skip_unneeded_hashes(cryptonote_connection_context& context, bool check_block_queue) const;
bool request_txpool_complement(cryptonote_connection_context &context);
+ void hit_score(cryptonote_connection_context &context, int32_t score);
t_core& m_core;
@@ -160,9 +161,10 @@ namespace cryptonote
std::atomic<bool> m_ask_for_txpool_complement;
boost::mutex m_sync_lock;
block_queue m_block_queue;
- epee::math_helper::once_a_time_seconds<30> m_idle_peer_kicker;
+ epee::math_helper::once_a_time_seconds<8> m_idle_peer_kicker;
epee::math_helper::once_a_time_milliseconds<100> m_standby_checker;
epee::math_helper::once_a_time_seconds<101> m_sync_search_checker;
+ epee::math_helper::once_a_time_seconds<43> m_bad_peer_checker;
std::atomic<unsigned int> m_max_out_peers;
tools::PerformanceTimer m_sync_timer, m_add_timer;
uint64_t m_last_add_end_time;
@@ -183,6 +185,8 @@ namespace cryptonote
double get_avg_block_size();
boost::circular_buffer<size_t> m_avg_buffer = boost::circular_buffer<size_t>(10);
+ boost::mutex m_bad_peer_check_lock;
+
template<class t_parameter>
bool post_notify(typename t_parameter::request& arg, cryptonote_connection_context& context)
{