@@ -1595,15 +1595,13 @@ void static ProcessGetData(CNode* pfrom, const CChainParams& chainparams, CConnm
1595
1595
std::vector<CInv> vNotFound;
1596
1596
const CNetMsgMaker msgMaker (pfrom->GetSendVersion ());
1597
1597
1598
- // Note that if we receive a getdata for a MSG_TX or MSG_WITNESS_TX from a
1599
- // block-relay-only outbound peer, we will stop processing further getdata
1600
- // messages from this peer (likely resulting in our peer eventually
1601
- // disconnecting us).
1602
- if (pfrom->m_tx_relay != nullptr ) {
1603
- // mempool entries added before this time have likely expired from mapRelay
1604
- const std::chrono::seconds longlived_mempool_time = GetTime<std::chrono::seconds>() - RELAY_TX_CACHE_TIME;
1605
- const std::chrono::seconds mempool_req = pfrom->m_tx_relay ->m_last_mempool_req .load ();
1598
+ // mempool entries added before this time have likely expired from mapRelay
1599
+ const std::chrono::seconds longlived_mempool_time = GetTime<std::chrono::seconds>() - RELAY_TX_CACHE_TIME;
1600
+ // Get last mempool request time
1601
+ const std::chrono::seconds mempool_req = pfrom->m_tx_relay != nullptr ? pfrom->m_tx_relay ->m_last_mempool_req .load ()
1602
+ : std::chrono::seconds::min ();
1606
1603
1604
+ {
1607
1605
LOCK (cs_main);
1608
1606
1609
1607
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
1613
1611
if (pfrom->fPauseSend )
1614
1612
break ;
1615
1613
1616
- const CInv &inv = *it;
1617
- it++;
1614
+ const CInv &inv = *it++;
1615
+
1616
+ if (pfrom->m_tx_relay == nullptr ) {
1617
+ // Ignore GETDATA requests for transactions from blocks-only peers.
1618
+ continue ;
1619
+ }
1618
1620
1619
1621
// Send stream from relay memory
1620
1622
bool push = false ;
0 commit comments