Skip to content

Commit

Permalink
Do not hold cs_vNodes in CSigSharesManager::SendMessages() for too lo…
Browse files Browse the repository at this point in the history
…ng (#2758)
  • Loading branch information
UdjinM6 committed Mar 11, 2019
1 parent fbf0dcb commit 3a5e7c4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/llmq/quorums_signing_shares.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1059,7 +1059,9 @@ bool CSigSharesManager::SendMessages()

bool didSend = false;

g_connman->ForEachNode([&](CNode* pnode) {
std::vector<CNode*> vNodesCopy = g_connman->CopyNodeVector(CConnman::FullyConnectedOnly);

for (auto& pnode : vNodesCopy) {
CNetMsgMaker msgMaker(pnode->GetSendVersion());

auto it1 = sigSessionAnnouncements.find(pnode->id);
Expand Down Expand Up @@ -1145,9 +1147,10 @@ bool CSigSharesManager::SendMessages()
didSend = true;
}
}
}

return true;
});
// looped through all nodes, release them
g_connman->ReleaseNodeVector(vNodesCopy);

if (didSend) {
g_connman->WakeSelect();
Expand Down

0 comments on commit 3a5e7c4

Please sign in to comment.