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.
This commit is contained in:
Gregory Maxwell
2016-05-21 09:45:32 +00:00
parent 862fd24b40
commit 4d8993b346
3 changed files with 30 additions and 31 deletions

View File

@@ -162,9 +162,6 @@ extern int nMaxConnections;
extern std::vector<CNode*> vNodes;
extern CCriticalSection cs_vNodes;
extern std::map<uint256, CTransaction> mapRelay;
extern std::deque<std::pair<int64_t, uint256> > vRelayExpiration;
extern CCriticalSection cs_mapRelay;
extern limitedmap<uint256, int64_t> mapAlreadyAskedFor;
extern std::vector<std::string> vAddedNodes;