diff options
| author | Gregory Maxwell <[email protected]> | 2016-05-21 09:45:32 +0000 |
|---|---|---|
| committer | Gregory Maxwell <[email protected]> | 2016-05-31 15:35:45 +0000 |
| commit | 4d8993b3469915d8c9ba4cd3b918f16782edf0de (patch) | |
| tree | 5456eaf96d2af1e346f77af0e52d91c710709b12 /src/net.cpp | |
| parent | Merge #8080: Do not use mempool for GETDATA for tx accepted after the last me... (diff) | |
| download | discoin-4d8993b3469915d8c9ba4cd3b918f16782edf0de.tar.xz discoin-4d8993b3469915d8c9ba4cd3b918f16782edf0de.zip | |
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.cpp | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/src/net.cpp b/src/net.cpp index 78a914ebd..c09e3aedb 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) { |