|
|
@ -1595,15 +1595,13 @@ void static ProcessGetData(CNode* pfrom, const CChainParams& chainparams, CConnm
|
|
|
|
std::vector<CInv> vNotFound;
|
|
|
|
std::vector<CInv> vNotFound;
|
|
|
|
const CNetMsgMaker msgMaker(pfrom->GetSendVersion());
|
|
|
|
const CNetMsgMaker msgMaker(pfrom->GetSendVersion());
|
|
|
|
|
|
|
|
|
|
|
|
// Note that if we receive a getdata for a MSG_TX or MSG_WITNESS_TX from a
|
|
|
|
// mempool entries added before this time have likely expired from mapRelay
|
|
|
|
// block-relay-only outbound peer, we will stop processing further getdata
|
|
|
|
const std::chrono::seconds longlived_mempool_time = GetTime<std::chrono::seconds>() - RELAY_TX_CACHE_TIME;
|
|
|
|
// messages from this peer (likely resulting in our peer eventually
|
|
|
|
// Get last mempool request time
|
|
|
|
// disconnecting us).
|
|
|
|
const std::chrono::seconds mempool_req = pfrom->m_tx_relay != nullptr ? pfrom->m_tx_relay->m_last_mempool_req.load()
|
|
|
|
if (pfrom->m_tx_relay != nullptr) {
|
|
|
|
: std::chrono::seconds::min();
|
|
|
|
// mempool entries added before this time have likely expired from mapRelay
|
|
|
|
|
|
|
|
const std::chrono::seconds longlived_mempool_time = GetTime<std::chrono::seconds>() - RELAY_TX_CACHE_TIME;
|
|
|
|
|
|
|
|
const std::chrono::seconds mempool_req = pfrom->m_tx_relay->m_last_mempool_req.load();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
LOCK(cs_main);
|
|
|
|
LOCK(cs_main);
|
|
|
|
|
|
|
|
|
|
|
|
while (it != pfrom->vRecvGetData.end() && (it->type == MSG_TX || it->type == MSG_WITNESS_TX)) {
|
|
|
|
while (it != pfrom->vRecvGetData.end() && (it->type == MSG_TX || it->type == MSG_WITNESS_TX)) {
|
|
|
@ -1613,8 +1611,12 @@ void static ProcessGetData(CNode* pfrom, const CChainParams& chainparams, CConnm
|
|
|
|
if (pfrom->fPauseSend)
|
|
|
|
if (pfrom->fPauseSend)
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
const CInv &inv = *it;
|
|
|
|
const CInv &inv = *it++;
|
|
|
|
it++;
|
|
|
|
|
|
|
|
|
|
|
|
if (pfrom->m_tx_relay == nullptr) {
|
|
|
|
|
|
|
|
// Ignore GETDATA requests for transactions from blocks-only peers.
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Send stream from relay memory
|
|
|
|
// Send stream from relay memory
|
|
|
|
bool push = false;
|
|
|
|
bool push = false;
|
|
|
|