diff options
author | luigi1111 <luigi1111w@gmail.com> | 2020-11-04 10:37:18 -0600 |
---|---|---|
committer | luigi1111 <luigi1111w@gmail.com> | 2020-11-04 10:37:18 -0600 |
commit | 7fa01f342c568aca90c640583ba518069363bed9 (patch) | |
tree | e2b139d345cecf48cbfaa1010a19f243f11ce86c | |
parent | Merge pull request #6962 (diff) | |
parent | Fix CLI and unrestricted RPC relay_tx with stempool (diff) | |
download | monero-7fa01f342c568aca90c640583ba518069363bed9.tar.xz |
Merge pull request #6966
42403c7 Fix CLI and unrestricted RPC relay_tx with stempool (vtnerd)
-rw-r--r-- | src/rpc/core_rpc_server.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp index f5ba5da9c..9b08971cd 100644 --- a/src/rpc/core_rpc_server.cpp +++ b/src/rpc/core_rpc_server.cpp @@ -2832,6 +2832,8 @@ namespace cryptonote RPC_TRACKER(relay_tx); CHECK_PAYMENT_MIN1(req, res, req.txids.size() * COST_PER_TX_RELAY, false); + const bool restricted = m_restricted && ctx; + bool failed = false; res.status = ""; for (const auto &str: req.txids) @@ -2845,12 +2847,16 @@ namespace cryptonote continue; } + //TODO: The get_pool_transaction could have an optional meta parameter + bool broadcasted = false; cryptonote::blobdata txblob; - if (m_core.get_pool_transaction(txid, txblob, relay_category::legacy)) + if ((broadcasted = m_core.get_pool_transaction(txid, txblob, relay_category::broadcasted)) || (!restricted && m_core.get_pool_transaction(txid, txblob, relay_category::all))) { + // The settings below always choose i2p/tor if enabled. Otherwise, do fluff iff previously relayed else dandelion++ stem. NOTIFY_NEW_TRANSACTIONS::request r; r.txs.push_back(std::move(txblob)); - m_core.get_protocol()->relay_transactions(r, boost::uuids::nil_uuid(), epee::net_utils::zone::invalid, relay_method::local); + const auto tx_relay = broadcasted ? relay_method::fluff : relay_method::local; + m_core.get_protocol()->relay_transactions(r, boost::uuids::nil_uuid(), epee::net_utils::zone::invalid, tx_relay); //TODO: make sure that tx has reached other nodes here, probably wait to receive reflections from other nodes } else |