diff --git a/src/net_processing.cpp b/src/net_processing.cpp index 6cfa51662..71fc8e0b7 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -2037,6 +2037,10 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr CInv inv(nInvType, tx.GetHash()); pfrom->AddInventoryKnown(inv); + { + LOCK(cs_main); + connman.RemoveAskFor(inv.hash); + } // Process custom logic, no matter if tx will be accepted to mempool later or not if (strCommand == NetMsgType::TXLOCKREQUEST || fCanAutoLock) { @@ -2083,8 +2087,6 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr LOCK(cs_main); - connman.RemoveAskFor(inv.hash); - bool fMissingInputs = false; CValidationState state;