From 7686af7acfa257b4e0df85e3c57f5bf821fd3f88 Mon Sep 17 00:00:00 2001 From: Lee *!* Clagett Date: Thu, 28 Mar 2024 19:02:17 -0400 Subject: Skip privacy networks (on tx sends) that don't have outgoing connections --- src/cryptonote_protocol/levin_notify.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/cryptonote_protocol/levin_notify.cpp') diff --git a/src/cryptonote_protocol/levin_notify.cpp b/src/cryptonote_protocol/levin_notify.cpp index 27c6d0278..92034a435 100644 --- a/src/cryptonote_protocol/levin_notify.cpp +++ b/src/cryptonote_protocol/levin_notify.cpp @@ -741,9 +741,14 @@ namespace levin notify::status notify::get_status() const noexcept { if (!zone_) - return {false, false}; - - return {!zone_->noise.empty(), CRYPTONOTE_NOISE_CHANNELS <= zone_->connection_count}; + return {false, false, false}; + + // `connection_count` is only set when `!noise.empty()`. + const std::size_t connection_count = zone_->connection_count; + bool has_outgoing = connection_count; + if (zone_->noise.empty()) + has_outgoing = zone_->p2p->get_out_connections_count(); + return {!zone_->noise.empty(), CRYPTONOTE_NOISE_CHANNELS <= connection_count, has_outgoing}; } void notify::new_out_connection() -- cgit v1.2.3