@@ -736,7 +736,7 @@ int64_t CalculateObjectGetDataTime(const CInv& inv, int64_t current_time, bool u
736736 return process_time;
737737}
738738
739- void RequestObject (CNodeState* state, const CInv& inv, int64_t nNow) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
739+ void RequestObject (CNodeState* state, const CInv& inv, int64_t nNow, bool fForce = false ) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
740740{
741741 AssertLockHeld (cs_main);
742742 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
754754 int64_t process_time = CalculateObjectGetDataTime (inv, nNow, !state->fPreferredDownload );
755755
756756 peer_download_state.m_tx_process_time .emplace (process_time, inv);
757+
758+ if (fForce ) {
759+ // make sure this object is actually requested ASAP
760+ g_erased_object_requests.erase (inv.hash );
761+ g_already_asked_for.erase (inv.hash );
762+ }
757763}
758764
759- void RequestObject (NodeId nodeId, const CInv& inv, int64_t nNow) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
765+ void RequestObject (NodeId nodeId, const CInv& inv, int64_t nNow, bool fForce ) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
760766{
761767 AssertLockHeld (cs_main);
762768 auto * state = State (nodeId);
763769 if (!state) {
764770 return ;
765771 }
766- RequestObject (state, inv, nNow);
772+ RequestObject (state, inv, nNow, fForce );
767773}
768774
769775size_t GetRequestedObjectCount (NodeId nodeId)
0 commit comments