aboutsummaryrefslogtreecommitdiff
path: root/src/checkqueue.h
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2020-08-21 09:23:42 +0300
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2020-09-24 06:53:39 +0300
commit0ef938685b5c079a6f5a98daf0e3865d718d817b (patch)
treeb4583e9933a57d781e8d7730c7f750ae0ef5e4c4 /src/checkqueue.h
parent1b313cacc99a1b372238f9036abed5491f9d28f7 (diff)
downloadbitcoin-0ef938685b5c079a6f5a98daf0e3865d718d817b.tar.xz
refactor: Use member initializers in CCheckQueue
Diffstat (limited to 'src/checkqueue.h')
-rw-r--r--src/checkqueue.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/checkqueue.h b/src/checkqueue.h
index e3faa1dec0..3e22cd8c60 100644
--- a/src/checkqueue.h
+++ b/src/checkqueue.h
@@ -44,23 +44,23 @@ private:
std::vector<T> queue;
//! The number of workers (including the master) that are idle.
- int nIdle;
+ int nIdle{0};
//! The total number of workers (including the master).
- int nTotal;
+ int nTotal{0};
//! The temporary evaluation result.
- bool fAllOk;
+ bool fAllOk{true};
/**
* Number of verifications that haven't completed yet.
* This includes elements that are no longer queued, but still in the
* worker's own batches.
*/
- unsigned int nTodo;
+ unsigned int nTodo{0};
//! The maximum number of elements to be processed in one batch
- unsigned int nBatchSize;
+ const unsigned int nBatchSize;
/** Internal function that does bulk of the verification work. */
bool Loop(bool fMaster = false)
@@ -127,7 +127,10 @@ public:
boost::mutex ControlMutex;
//! Create a new check queue
- explicit CCheckQueue(unsigned int nBatchSizeIn) : nIdle(0), nTotal(0), fAllOk(true), nTodo(0), nBatchSize(nBatchSizeIn) {}
+ explicit CCheckQueue(unsigned int nBatchSizeIn)
+ : nBatchSize(nBatchSizeIn)
+ {
+ }
//! Worker thread
void Thread()