Skip to content

Commit 4bfc20c

Browse files
committed
Force re-requesting of IS locked TXs
1 parent ef14b19 commit 4bfc20c

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

src/llmq/quorums_instantsend.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1345,7 +1345,7 @@ void CInstantSendManager::AskNodesForLockedTx(const uint256& txid)
13451345
txid.ToString(), pnode->GetId());
13461346

13471347
CInv inv(MSG_TX, txid);
1348-
RequestObject(pnode->GetId(), inv, GetTimeMicros());
1348+
RequestObject(pnode->GetId(), inv, GetTimeMicros(), true);
13491349
}
13501350
}
13511351
for (CNode* pnode : nodesToAskFor) {

src/net_processing.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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

769775
size_t GetRequestedObjectCount(NodeId nodeId)

src/net_processing.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ void Misbehaving(NodeId nodeid, int howmuch, const std::string& message="");
8585
bool IsBanned(NodeId nodeid);
8686

8787
void EraseObjectRequest(const uint256& hash);
88-
void RequestObject(NodeId nodeId, const CInv& inv, int64_t nNow);
88+
void RequestObject(NodeId nodeId, const CInv& inv, int64_t nNow, bool fForce=false);
8989
size_t GetRequestedObjectCount(NodeId nodeId);
9090

9191
#endif // BITCOIN_NET_PROCESSING_H

0 commit comments

Comments
 (0)