mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
txmempool: Make entry time type-safe (std::chrono)
This commit is contained in:
parent
faaa1f01da
commit
faec689bed
6 changed files with 16 additions and 15 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue