mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-17 13:07:54 +02:00
refactor: Add lock annotations to Active* methods
This is a refactor, putting the burden to think about thread safety to the caller. Otherwise, there is a risk that the caller will assume thread safety where none exists, as is evident in the previous two commits.
This commit is contained in:
parent
fac15ff673
commit
fac04cb6ba
11 changed files with 44 additions and 28 deletions
|
|
@ -115,12 +115,14 @@ int main(int argc, char* argv[])
|
|||
// Main program logic starts here
|
||||
std::cout
|
||||
<< "Hello! I'm going to print out some information about your datadir." << std::endl
|
||||
<< "\t" << "Path: " << gArgs.GetDataDirNet() << std::endl
|
||||
<< "\t" << "Path: " << gArgs.GetDataDirNet() << std::endl;
|
||||
{
|
||||
LOCK(chainman.GetMutex());
|
||||
std::cout
|
||||
<< "\t" << "Reindexing: " << std::boolalpha << node::fReindex.load() << std::noboolalpha << std::endl
|
||||
<< "\t" << "Snapshot Active: " << std::boolalpha << chainman.IsSnapshotActive() << std::noboolalpha << std::endl
|
||||
<< "\t" << "Active Height: " << chainman.ActiveHeight() << std::endl
|
||||
<< "\t" << "Active IBD: " << std::boolalpha << chainman.ActiveChainstate().IsInitialBlockDownload() << std::noboolalpha << std::endl;
|
||||
{
|
||||
CBlockIndex* tip = chainman.ActiveTip();
|
||||
if (tip) {
|
||||
std::cout << "\t" << tip->ToString() << std::endl;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue