diff --git a/src/llmq/quorums_instantsend.cpp b/src/llmq/quorums_instantsend.cpp index b85cf3f261..a4637fa95b 100644 --- a/src/llmq/quorums_instantsend.cpp +++ b/src/llmq/quorums_instantsend.cpp @@ -1345,7 +1345,7 @@ void CInstantSendManager::AskNodesForLockedTx(const uint256& txid) txid.ToString(), pnode->GetId()); CInv inv(MSG_TX, txid); - RequestObject(pnode->GetId(), inv, GetTimeMicros()); + RequestObject(pnode->GetId(), inv, GetTimeMicros(), true); } } for (CNode* pnode : nodesToAskFor) { diff --git a/src/net_processing.cpp b/src/net_processing.cpp index 3f9d93765e..c7898f0e8b 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -736,7 +736,7 @@ int64_t CalculateObjectGetDataTime(const CInv& inv, int64_t current_time, bool u return process_time; } -void RequestObject(CNodeState* state, const CInv& inv, int64_t nNow) EXCLUSIVE_LOCKS_REQUIRED(cs_main) +void RequestObject(CNodeState* state, const CInv& inv, int64_t nNow, bool fForce = false) EXCLUSIVE_LOCKS_REQUIRED(cs_main) { AssertLockHeld(cs_main); CNodeState::TxDownloadState& peer_download_state = state->m_tx_download; @@ -754,16 +754,22 @@ void RequestObject(CNodeState* state, const CInv& inv, int64_t nNow) EXCLUSIVE_L int64_t process_time = CalculateObjectGetDataTime(inv, nNow, !state->fPreferredDownload); peer_download_state.m_tx_process_time.emplace(process_time, inv); + + if (fForce) { + // make sure this object is actually requested ASAP + g_erased_object_requests.erase(inv.hash); + g_already_asked_for.erase(inv.hash); + } } -void RequestObject(NodeId nodeId, const CInv& inv, int64_t nNow) EXCLUSIVE_LOCKS_REQUIRED(cs_main) +void RequestObject(NodeId nodeId, const CInv& inv, int64_t nNow, bool fForce) EXCLUSIVE_LOCKS_REQUIRED(cs_main) { AssertLockHeld(cs_main); auto* state = State(nodeId); if (!state) { return; } - RequestObject(state, inv, nNow); + RequestObject(state, inv, nNow, fForce); } size_t GetRequestedObjectCount(NodeId nodeId) diff --git a/src/net_processing.h b/src/net_processing.h index ced80382e6..55890f74f1 100644 --- a/src/net_processing.h +++ b/src/net_processing.h @@ -85,7 +85,7 @@ void Misbehaving(NodeId nodeid, int howmuch, const std::string& message=""); bool IsBanned(NodeId nodeid); void EraseObjectRequest(const uint256& hash); -void RequestObject(NodeId nodeId, const CInv& inv, int64_t nNow); +void RequestObject(NodeId nodeId, const CInv& inv, int64_t nNow, bool fForce=false); size_t GetRequestedObjectCount(NodeId nodeId); #endif // BITCOIN_NET_PROCESSING_H