diff --git a/nano/node/node.cpp b/nano/node/node.cpp index b2feeb4e6f..6fa9be05e7 100644 --- a/nano/node/node.cpp +++ b/nano/node/node.cpp @@ -1325,6 +1325,11 @@ nano::telemetry_data nano::node::local_telemetry () const return telemetry_data; } +std::string nano::node::identifier () const +{ + return make_logger_identifier (node_id); +} + std::string nano::node::make_logger_identifier (const nano::keypair & node_id) { // Node identifier consists of first 10 characters of node id diff --git a/nano/node/node.hpp b/nano/node/node.hpp index 2015082794..bbd19f50bb 100644 --- a/nano/node/node.hpp +++ b/nano/node/node.hpp @@ -133,6 +133,7 @@ class node final : public std::enable_shared_from_this void bootstrap_block (nano::block_hash const &); nano::account get_node_id () const; nano::telemetry_data local_telemetry () const; + std::string identifier () const; public: const nano::keypair node_id; diff --git a/nano/test_common/system.cpp b/nano/test_common/system.cpp index 02a0499bb8..0a4ffb4205 100644 --- a/nano/test_common/system.cpp +++ b/nano/test_common/system.cpp @@ -138,9 +138,11 @@ std::shared_ptr nano::test::system::add_node (nano::node_config cons auto starting_keepalives_1 = node1->stats.count (stat::type::message, stat::detail::keepalive, stat::dir::in); auto starting_keepalives_2 = node2->stats.count (stat::type::message, stat::detail::keepalive, stat::dir::in); + logger.debug (nano::log::type::system, "Connecting nodes: {} and {}", node1->identifier (), node2->identifier ()); + // TCP is the only transport layer available. debug_assert (type_a == nano::transport::transport_type::tcp); - (*j)->network.merge_peer ((*i)->network.endpoint ()); + node1->network.merge_peer (node2->network.endpoint ()); { auto ec = poll_until_true (5s, [&node1, &node2, starting_size_1, starting_size_2] () {