mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-18 22:35:39 +01:00
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)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user