-
Notifications
You must be signed in to change notification settings - Fork 1.2k
llmq: Fix thread handling in CDKGSessionManager and CDKGSessionHandler #3601
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
6a23255
6fedfb7
1061775
0103306
ef66d06
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,27 +24,29 @@ CDKGSessionManager::CDKGSessionManager(CDBWrapper& _llmqDb, CBLSWorker& _blsWork | |
llmqDb(_llmqDb), | ||
blsWorker(_blsWorker) | ||
{ | ||
for (const auto& qt : Params().GetConsensus().llmqs) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why's this called qt? maybe There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have no idea why its called like that i just moved it around a bit. But it represents a key/value pair from the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What if we make it not auto so it's clearer what this is referring to. IMO we should only really be using auto where by the name of it and the surrounding code it's obvious. I guess it's obvious in the sense you can look at There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Hm.. so for me that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, it's fine how it is. Just makes code review easier when it's obvious what variables mean |
||
dkgSessionHandlers.emplace(std::piecewise_construct, | ||
std::forward_as_tuple(qt.first), | ||
std::forward_as_tuple(qt.second, blsWorker, *this)); | ||
} | ||
} | ||
|
||
CDKGSessionManager::~CDKGSessionManager() | ||
{ | ||
} | ||
|
||
void CDKGSessionManager::StartMessageHandlerPool() | ||
void CDKGSessionManager::StartThreads() | ||
{ | ||
for (const auto& qt : Params().GetConsensus().llmqs) { | ||
dkgSessionHandlers.emplace(std::piecewise_construct, | ||
std::forward_as_tuple(qt.first), | ||
std::forward_as_tuple(qt.second, messageHandlerPool, blsWorker, *this)); | ||
for (auto& it : dkgSessionHandlers) { | ||
it.second.StartThread(); | ||
} | ||
|
||
messageHandlerPool.resize(2); | ||
RenameThreadPool(messageHandlerPool, "dash-q-msg"); | ||
} | ||
|
||
void CDKGSessionManager::StopMessageHandlerPool() | ||
void CDKGSessionManager::StopThreads() | ||
{ | ||
messageHandlerPool.stop(true); | ||
for (auto& it : dkgSessionHandlers) { | ||
it.second.StopThread(); | ||
} | ||
} | ||
|
||
void CDKGSessionManager::UpdatedBlockTip(const CBlockIndex* pindexNew, bool fInitialDownload) | ||
|
Uh oh!
There was an error while loading. Please reload this page.