Skip to content

Commit

Permalink
Merge pull request #6376
Browse files Browse the repository at this point in the history
6177e49 Added logging for dropped local txes with no i2p/tor connections (vtnerd)
  • Loading branch information
luigi1111 committed Mar 9, 2020
2 parents 7ca6b55 + 6177e49 commit 17ec003
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/cryptonote_protocol/levin_notify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
#include "net/dandelionpp.h"
#include "p2p/net_node.h"

#undef MONERO_DEFAULT_LOG_CATEGORY
#define MONERO_DEFAULT_LOG_CATEGORY "net.p2p.tx"

namespace cryptonote
{
namespace levin
Expand Down Expand Up @@ -242,6 +245,8 @@ namespace levin

if (!channel.connection.is_nil())
channel.queue.push_back(std::move(message_));
else if (destination_ == 0 && zone_->connection_count == 0)
MWARNING("Unable to send transaction(s) over anonymity network - no available outbound connections");
}
};

Expand Down Expand Up @@ -286,8 +291,12 @@ namespace levin
return true;
});

bool sent = false;
for (const boost::uuids::uuid& connection : connections)
zone_->p2p->send(message_.clone(), connection);
sent |= zone_->p2p->send(message_.clone(), connection);

if (!sent)
MWARNING("Unable to send transaction(s), no available connections");
}
};

Expand Down Expand Up @@ -441,9 +450,12 @@ namespace levin
{
channel.active = nullptr;
channel.connection = boost::uuids::nil_uuid();
zone_->strand.post(
update_channels{zone_, get_out_connections(*zone_->p2p)}
);

auto connections = get_out_connections(*zone_->p2p);
if (connections.empty())
MWARNING("Lost all outbound connections to anonymity network - currently unable to send transaction(s)");

zone_->strand.post(update_channels{zone_, std::move(connections)});
}
}

Expand Down

0 comments on commit 17ec003

Please sign in to comment.