aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
diff options
context:
space:
mode:
authorGregory Maxwell <greg@xiph.org>2016-05-21 09:45:32 +0000
committerGregory Maxwell <greg@xiph.org>2016-05-31 15:35:45 +0000
commit4d8993b3469915d8c9ba4cd3b918f16782edf0de (patch)
tree5456eaf96d2af1e346f77af0e52d91c710709b12 /src/net.cpp
parent862fd24b40b478f815dcb5df4f705cae2c0a1cf9 (diff)
Defer inserting into maprelay until just before relaying.
This reduces the rate of not founds by better matching the far end expectations, it also improves privacy by removing the ability to use getdata to probe for a node having a txn before it has been relayed.
Diffstat (limited to 'src/net.cpp')
-rw-r--r--src/net.cpp15
1 files changed, 0 insertions, 15 deletions
diff --git a/src/net.cpp b/src/net.cpp
index 78a914ebdf..c09e3aedb6 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -90,9 +90,6 @@ std::string strSubVersion;
std::vector<CNode*> vNodes;
CCriticalSection cs_vNodes;
-std::map<uint256, CTransaction> mapRelay;
-std::deque<std::pair<int64_t, uint256> > vRelayExpiration;
-CCriticalSection cs_mapRelay;
limitedmap<uint256, int64_t> mapAlreadyAskedFor(MAX_INV_SZ);
static std::deque<std::string> vOneShots;
@@ -2081,18 +2078,6 @@ instance_of_cnetcleanup;
void RelayTransaction(const CTransaction& tx)
{
CInv inv(MSG_TX, tx.GetHash());
- {
- LOCK(cs_mapRelay);
- // Expire old relay messages
- while (!vRelayExpiration.empty() && vRelayExpiration.front().first < GetTime())
- {
- mapRelay.erase(vRelayExpiration.front().second);
- vRelayExpiration.pop_front();
- }
-
- mapRelay.insert(std::make_pair(inv.hash, tx));
- vRelayExpiration.push_back(std::make_pair(GetTime() + 15 * 60, inv.hash));
- }
LOCK(cs_vNodes);
BOOST_FOREACH(CNode* pnode, vNodes)
{