From 5d7ae2d2791c0244a221872a7ac62627abb81896 Mon Sep 17 00:00:00 2001 From: Lee Clagett Date: Sat, 2 Nov 2019 20:36:03 +0000 Subject: Adding support for hidden (anonymity) txpool --- src/p2p/net_node.inl | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/p2p/net_node.inl') diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl index f8094bfa8..45bb10593 100644 --- a/src/p2p/net_node.inl +++ b/src/p2p/net_node.inl @@ -2053,13 +2053,18 @@ namespace nodetool } //----------------------------------------------------------------------------------- template - epee::net_utils::zone node_server::send_txs(std::vector txs, const epee::net_utils::zone origin, const boost::uuids::uuid& source, const bool pad_txs) + epee::net_utils::zone node_server::send_txs(std::vector txs, const epee::net_utils::zone origin, const boost::uuids::uuid& source, cryptonote::i_core_events& core, const bool pad_txs) { namespace enet = epee::net_utils; - const auto send = [&txs, &source, pad_txs] (std::pair& network) + const auto send = [&txs, &source, &core, pad_txs] (std::pair& network) { - if (network.second.m_notifier.send_txs(std::move(txs), source, (pad_txs || network.first != enet::zone::public_))) + const bool is_public = (network.first == enet::zone::public_); + const cryptonote::relay_method tx_relay = is_public ? + cryptonote::relay_method::flood : cryptonote::relay_method::local; + + core.on_transactions_relayed(epee::to_span(txs), tx_relay); + if (network.second.m_notifier.send_txs(std::move(txs), source, (pad_txs || !is_public))) return network.first; return enet::zone::invalid; }; -- cgit v1.2.3