mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 14:53:43 +01:00
txmempool: Make entry time type-safe (std::chrono)
This commit is contained in:
@@ -1541,11 +1541,11 @@ void static ProcessGetData(CNode* pfrom, const CChainParams& chainparams, CConnm
|
||||
if (mi != mapRelay.end()) {
|
||||
connman->PushMessage(pfrom, msgMaker.Make(nSendFlags, NetMsgType::TX, *mi->second));
|
||||
push = true;
|
||||
} else if (pfrom->m_tx_relay->timeLastMempoolReq) {
|
||||
} else if (pfrom->m_tx_relay->m_last_mempool_req.load().count()) {
|
||||
auto txinfo = mempool.info(inv.hash);
|
||||
// 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 (txinfo.tx && txinfo.nTime <= pfrom->m_tx_relay->timeLastMempoolReq) {
|
||||
if (txinfo.tx && txinfo.m_time <= pfrom->m_tx_relay->m_last_mempool_req.load()) {
|
||||
connman->PushMessage(pfrom, msgMaker.Make(nSendFlags, NetMsgType::TX, *txinfo.tx));
|
||||
push = true;
|
||||
}
|
||||
@@ -3873,7 +3873,7 @@ bool PeerLogicValidation::SendMessages(CNode* pto)
|
||||
vInv.clear();
|
||||
}
|
||||
}
|
||||
pto->m_tx_relay->timeLastMempoolReq = GetTime();
|
||||
pto->m_tx_relay->m_last_mempool_req = GetTime<std::chrono::seconds>();
|
||||
}
|
||||
|
||||
// Determine transactions to relay
|
||||
|
||||
Reference in New Issue
Block a user