Skip privacy networks (on tx sends) that don't have outgoing connections

This commit is contained in:
Lee *!* Clagett
2024-03-29 13:01:58 -04:00
parent c8214782fb
commit 463228b961
4 changed files with 45 additions and 5 deletions
+7 -2
View File
@@ -741,9 +741,14 @@ namespace levin
notify::status notify::get_status() const noexcept
{
if (!zone_)
return {false, false};
return {false, false, false};
return {!zone_->noise.empty(), CRYPTONOTE_NOISE_CHANNELS <= zone_->connection_count};
// `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()