aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index ffc57d48be..c2905784f0 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