mirror of
https://github.com/monero-project/monero.git
synced 2025-01-28 18:56:31 +02:00
debug logs: add peer group to peerlist
This commit is contained in:
parent
167a549884
commit
4159aa51bd
@ -2164,7 +2164,7 @@ namespace nodetool
|
||||
}
|
||||
|
||||
LOG_DEBUG_CC(context, "REMOTE PEERLIST: remote peerlist size=" << peerlist_.size());
|
||||
LOG_TRACE_CC(context, "REMOTE PEERLIST: " << ENDL << print_peerlist_to_string(peerlist_));
|
||||
LOG_TRACE_CC(context, "REMOTE PEERLIST: " << ENDL << print_peerlist_to_string(peerlist_, m_asmap));
|
||||
CRITICAL_REGION_LOCAL(m_blocked_hosts_lock);
|
||||
return m_network_zones.at(context.m_remote_address.get_zone()).m_peerlist.merge_peerlist(peerlist_, [this](const peerlist_entry &pe) {
|
||||
return !is_addr_recently_failed(pe.adr) && is_remote_host_allowed(pe.adr);
|
||||
@ -2614,7 +2614,7 @@ namespace nodetool
|
||||
std::vector<peerlist_entry> pl_gray;
|
||||
for (auto& zone : m_network_zones)
|
||||
zone.second.m_peerlist.get_peerlist(pl_gray, pl_white);
|
||||
MINFO(ENDL << "Peerlist white:" << ENDL << print_peerlist_to_string(pl_white) << ENDL << "Peerlist gray:" << ENDL << print_peerlist_to_string(pl_gray) );
|
||||
MINFO(ENDL << "Peerlist white:" << ENDL << print_peerlist_to_string(pl_white, m_asmap) << ENDL << "Peerlist gray:" << ENDL << print_peerlist_to_string(pl_gray, m_asmap) );
|
||||
return true;
|
||||
}
|
||||
//-----------------------------------------------------------------------------------
|
||||
|
@ -37,6 +37,7 @@
|
||||
#include "net/net_utils_base.h"
|
||||
#include "net/tor_address.h" // needed for serialization
|
||||
#include "net/i2p_address.h" // needed for serialization
|
||||
#include "net/group.h"
|
||||
#include "misc_language.h"
|
||||
#include "string_tools.h"
|
||||
#include "time_helper.h"
|
||||
@ -143,7 +144,7 @@ namespace nodetool
|
||||
#pragma pack(pop)
|
||||
|
||||
inline
|
||||
std::string print_peerlist_to_string(const std::vector<peerlist_entry>& pl)
|
||||
std::string print_peerlist_to_string(const std::vector<peerlist_entry>& pl, const std::vector<bool> &asmap)
|
||||
{
|
||||
time_t now_time = 0;
|
||||
time(&now_time);
|
||||
@ -156,6 +157,7 @@ namespace nodetool
|
||||
<< " \trpc credits per hash " << (pe.rpc_credits_per_hash > 0 ? std::to_string(pe.rpc_credits_per_hash) : "-")
|
||||
<< " \tpruning seed " << pe.pruning_seed
|
||||
<< " \tlast_seen: " << (pe.last_seen == 0 ? std::string("never") : epee::misc_utils::get_time_interval_string(now_time - pe.last_seen))
|
||||
<< " \tbucket: " << net::group::get_group(pe.adr, asmap)
|
||||
<< std::endl;
|
||||
}
|
||||
return ss.str();
|
||||
|
Loading…
Reference in New Issue
Block a user