diff options
| author | Wladimir J. van der Laan <[email protected]> | 2016-05-31 15:47:15 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2016-05-31 15:47:32 +0200 |
| commit | 862fd24b40b478f815dcb5df4f705cae2c0a1cf9 (patch) | |
| tree | e76f4407498a0df5a8b017b9a3102f92de074c0a /src/main.cpp | |
| parent | Merge #8090: Adding P2SH(p2pkh) script test case (diff) | |
| parent | Do not use mempool for GETDATA for tx accepted after the last mempool req. (diff) | |
| download | discoin-862fd24b40b478f815dcb5df4f705cae2c0a1cf9.tar.xz discoin-862fd24b40b478f815dcb5df4f705cae2c0a1cf9.zip | |
Merge #8080: Do not use mempool for GETDATA for tx accepted after the last mempool req.
7e908c7 Do not use mempool for GETDATA for tx accepted after the last mempool req. (Gregory Maxwell)
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp index ffc57d48b..c2905784f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4513,7 +4513,10 @@ void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParam } if (!pushed && inv.type == MSG_TX) { CTransaction tx; - if (mempool.lookup(inv.hash, tx)) { + int64_t txtime; + // To protect privacy, do not answer getdata using the mempool when + // that TX couldn't have been INVed in reply to a MEMPOOL request. + if (mempool.lookup(inv.hash, tx, txtime) && txtime <= pfrom->timeLastMempoolReq) { pfrom->PushMessage(NetMsgType::TX, tx); pushed = true; } @@ -5911,6 +5914,7 @@ bool SendMessages(CNode* pto) vInv.clear(); } } + pto->timeLastMempoolReq = GetTime(); } // Determine transactions to relay |