diff --git a/src/net_processing.cpp b/src/net_processing.cpp --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -1989,15 +1989,6 @@ } } - { - LOCK(cs_main); - // Look up transaction in relay pool - auto mi = mapRelay.find(txid); - if (mi != mapRelay.end()) { - return mi->second; - } - } - auto txinfo = g_mempool.info(txid); if (txinfo.tx) { // To protect privacy, do not answer getdata using the mempool when @@ -2009,6 +2000,15 @@ } } + { + LOCK(cs_main); + // Look up transaction in relay pool + auto mi = mapRelay.find(txid); + if (mi != mapRelay.end()) { + return mi->second; + } + } + return {}; }