aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/coins.cpp2
-rw-r--r--src/coins.h2
-rw-r--r--src/crypto/ripemd160.cpp2
-rw-r--r--src/crypto/ripemd160.h2
-rw-r--r--src/crypto/sha1.cpp2
-rw-r--r--src/crypto/sha1.h2
-rw-r--r--src/crypto/sha256.cpp2
-rw-r--r--src/crypto/sha256.h2
-rw-r--r--src/crypto/sha512.cpp2
-rw-r--r--src/crypto/sha512.h2
-rw-r--r--src/cuckoocache.h11
-rw-r--r--src/dbwrapper.h4
-rw-r--r--src/key.h6
-rw-r--r--src/policy/fees.cpp2
-rw-r--r--src/policy/fees.h18
-rw-r--r--src/serialize.h4
-rw-r--r--src/span.h4
-rw-r--r--src/streams.h6
-rw-r--r--src/support/lockedpool.cpp4
-rw-r--r--src/support/lockedpool.h2
-rw-r--r--src/test/util/net.h4
-rw-r--r--src/tinyformat.h9
-rw-r--r--src/torcontrol.cpp4
-rw-r--r--src/torcontrol.h2
-rw-r--r--src/univalue/include/univalue_utffilter.h12
-rw-r--r--src/util/sock.h4
-rw-r--r--src/wallet/bdb.cpp2
-rw-r--r--src/wallet/bdb.h4
-rw-r--r--src/wallet/db.h8
-rw-r--r--src/wallet/wallet.h4
-rw-r--r--src/zmq/zmqabstractnotifier.h4
-rw-r--r--src/zmq/zmqnotificationinterface.cpp2
-rw-r--r--src/zmq/zmqnotificationinterface.h2
33 files changed, 69 insertions, 73 deletions
diff --git a/src/coins.cpp b/src/coins.cpp
index 31ac67674a..e98bf816ab 100644
--- a/src/coins.cpp
+++ b/src/coins.cpp
@@ -32,7 +32,7 @@ bool CCoinsViewBacked::BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock,
std::unique_ptr<CCoinsViewCursor> CCoinsViewBacked::Cursor() const { return base->Cursor(); }
size_t CCoinsViewBacked::EstimateSize() const { return base->EstimateSize(); }
-CCoinsViewCache::CCoinsViewCache(CCoinsView *baseIn) : CCoinsViewBacked(baseIn), cachedCoinsUsage(0) {}
+CCoinsViewCache::CCoinsViewCache(CCoinsView* baseIn) : CCoinsViewBacked(baseIn) {}
size_t CCoinsViewCache::DynamicMemoryUsage() const {
return memusage::DynamicUsage(cacheCoins) + cachedCoinsUsage;
diff --git a/src/coins.h b/src/coins.h
index 4edc146a14..710b8c7c83 100644
--- a/src/coins.h
+++ b/src/coins.h
@@ -220,7 +220,7 @@ protected:
mutable CCoinsMap cacheCoins;
/* Cached dynamic memory usage for the inner Coin objects. */
- mutable size_t cachedCoinsUsage;
+ mutable size_t cachedCoinsUsage{0};
public:
CCoinsViewCache(CCoinsView *baseIn);
diff --git a/src/crypto/ripemd160.cpp b/src/crypto/ripemd160.cpp
index 29a4ad906f..a2f7c6e156 100644
--- a/src/crypto/ripemd160.cpp
+++ b/src/crypto/ripemd160.cpp
@@ -239,7 +239,7 @@ void Transform(uint32_t* s, const unsigned char* chunk)
////// RIPEMD160
-CRIPEMD160::CRIPEMD160() : bytes(0)
+CRIPEMD160::CRIPEMD160()
{
ripemd160::Initialize(s);
}
diff --git a/src/crypto/ripemd160.h b/src/crypto/ripemd160.h
index ae9c339181..fb631a66d2 100644
--- a/src/crypto/ripemd160.h
+++ b/src/crypto/ripemd160.h
@@ -14,7 +14,7 @@ class CRIPEMD160
private:
uint32_t s[5];
unsigned char buf[64];
- uint64_t bytes;
+ uint64_t bytes{0};
public:
static const size_t OUTPUT_SIZE = 20;
diff --git a/src/crypto/sha1.cpp b/src/crypto/sha1.cpp
index 1fb9bb2b72..2610108f60 100644
--- a/src/crypto/sha1.cpp
+++ b/src/crypto/sha1.cpp
@@ -146,7 +146,7 @@ void Transform(uint32_t* s, const unsigned char* chunk)
////// SHA1
-CSHA1::CSHA1() : bytes(0)
+CSHA1::CSHA1()
{
sha1::Initialize(s);
}
diff --git a/src/crypto/sha1.h b/src/crypto/sha1.h
index 4bd6c331a8..741cdaad58 100644
--- a/src/crypto/sha1.h
+++ b/src/crypto/sha1.h
@@ -14,7 +14,7 @@ class CSHA1
private:
uint32_t s[5];
unsigned char buf[64];
- uint64_t bytes;
+ uint64_t bytes{0};
public:
static const size_t OUTPUT_SIZE = 20;
diff --git a/src/crypto/sha256.cpp b/src/crypto/sha256.cpp
index 7cd5b3661b..a4eef36480 100644
--- a/src/crypto/sha256.cpp
+++ b/src/crypto/sha256.cpp
@@ -673,7 +673,7 @@ std::string SHA256AutoDetect()
////// SHA-256
-CSHA256::CSHA256() : bytes(0)
+CSHA256::CSHA256()
{
sha256::Initialize(s);
}
diff --git a/src/crypto/sha256.h b/src/crypto/sha256.h
index 9fd73becfd..7625508665 100644
--- a/src/crypto/sha256.h
+++ b/src/crypto/sha256.h
@@ -15,7 +15,7 @@ class CSHA256
private:
uint32_t s[8];
unsigned char buf[64];
- uint64_t bytes;
+ uint64_t bytes{0};
public:
static const size_t OUTPUT_SIZE = 32;
diff --git a/src/crypto/sha512.cpp b/src/crypto/sha512.cpp
index 8a822e0e7e..2713f06210 100644
--- a/src/crypto/sha512.cpp
+++ b/src/crypto/sha512.cpp
@@ -151,7 +151,7 @@ void Transform(uint64_t* s, const unsigned char* chunk)
////// SHA-512
-CSHA512::CSHA512() : bytes(0)
+CSHA512::CSHA512()
{
sha512::Initialize(s);
}
diff --git a/src/crypto/sha512.h b/src/crypto/sha512.h
index d8fa8d2e39..d2f7d6a05e 100644
--- a/src/crypto/sha512.h
+++ b/src/crypto/sha512.h
@@ -14,7 +14,7 @@ class CSHA512
private:
uint64_t s[8];
unsigned char buf[128];
- uint64_t bytes;
+ uint64_t bytes{0};
public:
static constexpr size_t OUTPUT_SIZE = 64;
diff --git a/src/cuckoocache.h b/src/cuckoocache.h
index 6adcc74516..cb0b362143 100644
--- a/src/cuckoocache.h
+++ b/src/cuckoocache.h
@@ -166,7 +166,7 @@ private:
std::vector<Element> table;
/** size stores the total available slots in the hash table */
- uint32_t size;
+ uint32_t size{0};
/** The bit_packed_atomic_flags array is marked mutable because we want
* garbage collection to be allowed to occur from const methods */
@@ -183,7 +183,7 @@ private:
* decremented on insert and reset to the new number of inserts which would
* cause the epoch to reach epoch_size when it reaches zero.
*/
- uint32_t epoch_heuristic_counter;
+ uint32_t epoch_heuristic_counter{0};
/** epoch_size is set to be the number of elements supposed to be in a
* epoch. When the number of non-erased elements in an epoch
@@ -193,12 +193,12 @@ private:
* one "dead" which has been erased, one "dying" which has been marked to be
* erased next, and one "living" which new inserts add to.
*/
- uint32_t epoch_size;
+ uint32_t epoch_size{0};
/** depth_limit determines how many elements insert should try to replace.
* Should be set to log2(n).
*/
- uint8_t depth_limit;
+ uint8_t depth_limit{0};
/** hash_function is a const instance of the hash function. It cannot be
* static or initialized at call time as it may have internal state (such as
@@ -322,8 +322,7 @@ public:
/** You must always construct a cache with some elements via a subsequent
* call to setup or setup_bytes, otherwise operations may segfault.
*/
- cache() : table(), size(), collection_flags(0), epoch_flags(),
- epoch_heuristic_counter(), epoch_size(), depth_limit(0), hash_function()
+ cache() : table(), collection_flags(0), epoch_flags(), hash_function()
{
}
diff --git a/src/dbwrapper.h b/src/dbwrapper.h
index f47bd8188e..b389d039fb 100644
--- a/src/dbwrapper.h
+++ b/src/dbwrapper.h
@@ -71,13 +71,13 @@ private:
DataStream ssKey{};
CDataStream ssValue;
- size_t size_estimate;
+ size_t size_estimate{0};
public:
/**
* @param[in] _parent CDBWrapper that this batch is to be submitted to
*/
- explicit CDBBatch(const CDBWrapper& _parent) : parent(_parent), ssValue(SER_DISK, CLIENT_VERSION), size_estimate(0){};
+ explicit CDBBatch(const CDBWrapper& _parent) : parent(_parent), ssValue(SER_DISK, CLIENT_VERSION){};
void Clear()
{
diff --git a/src/key.h b/src/key.h
index d5b662c6fc..4e092fffea 100644
--- a/src/key.h
+++ b/src/key.h
@@ -42,10 +42,10 @@ public:
private:
//! Whether this private key is valid. We check for correctness when modifying the key
//! data, so fValid should always correspond to the actual state.
- bool fValid;
+ bool fValid{false};
//! Whether the public key corresponding to this private key is (to be) compressed.
- bool fCompressed;
+ bool fCompressed{false};
//! The actual byte data
std::vector<unsigned char, secure_allocator<unsigned char> > keydata;
@@ -55,7 +55,7 @@ private:
public:
//! Construct an invalid private key.
- CKey() : fValid(false), fCompressed(false)
+ CKey()
{
// Important: vch must be 32 bytes in length to not break serialization
keydata.resize(32);
diff --git a/src/policy/fees.cpp b/src/policy/fees.cpp
index e4eb932e5c..d244de1bb2 100644
--- a/src/policy/fees.cpp
+++ b/src/policy/fees.cpp
@@ -528,7 +528,7 @@ bool CBlockPolicyEstimator::_removeTx(const uint256& hash, bool inBlock)
}
CBlockPolicyEstimator::CBlockPolicyEstimator(const fs::path& estimation_filepath)
- : m_estimation_filepath{estimation_filepath}, nBestSeenHeight{0}, firstRecordedHeight{0}, historicalFirst{0}, historicalBest{0}, trackedTxs{0}, untrackedTxs{0}
+ : m_estimation_filepath{estimation_filepath}
{
static_assert(MIN_BUCKET_FEERATE > 0, "Min feerate must be nonzero");
size_t bucketIndex = 0;
diff --git a/src/policy/fees.h b/src/policy/fees.h
index dd4f031180..1c24b8c7c3 100644
--- a/src/policy/fees.h
+++ b/src/policy/fees.h
@@ -242,16 +242,16 @@ public:
private:
mutable Mutex m_cs_fee_estimator;
- unsigned int nBestSeenHeight GUARDED_BY(m_cs_fee_estimator);
- unsigned int firstRecordedHeight GUARDED_BY(m_cs_fee_estimator);
- unsigned int historicalFirst GUARDED_BY(m_cs_fee_estimator);
- unsigned int historicalBest GUARDED_BY(m_cs_fee_estimator);
+ unsigned int nBestSeenHeight GUARDED_BY(m_cs_fee_estimator){0};
+ unsigned int firstRecordedHeight GUARDED_BY(m_cs_fee_estimator){0};
+ unsigned int historicalFirst GUARDED_BY(m_cs_fee_estimator){0};
+ unsigned int historicalBest GUARDED_BY(m_cs_fee_estimator){0};
struct TxStatsInfo
{
- unsigned int blockHeight;
- unsigned int bucketIndex;
- TxStatsInfo() : blockHeight(0), bucketIndex(0) {}
+ unsigned int blockHeight{0};
+ unsigned int bucketIndex{0};
+ TxStatsInfo() {}
};
// map of txids to information about that transaction
@@ -262,8 +262,8 @@ private:
std::unique_ptr<TxConfirmStats> shortStats PT_GUARDED_BY(m_cs_fee_estimator);
std::unique_ptr<TxConfirmStats> longStats PT_GUARDED_BY(m_cs_fee_estimator);
- unsigned int trackedTxs GUARDED_BY(m_cs_fee_estimator);
- unsigned int untrackedTxs GUARDED_BY(m_cs_fee_estimator);
+ unsigned int trackedTxs GUARDED_BY(m_cs_fee_estimator){0};
+ unsigned int untrackedTxs GUARDED_BY(m_cs_fee_estimator){0};
std::vector<double> buckets GUARDED_BY(m_cs_fee_estimator); // The upper-bound of the range for the bucket (inclusive)
std::map<double, unsigned int> bucketMap GUARDED_BY(m_cs_fee_estimator); // Map of bucket upper-bound to index into all vectors by bucket
diff --git a/src/serialize.h b/src/serialize.h
index f1edc54031..7bc7b10779 100644
--- a/src/serialize.h
+++ b/src/serialize.h
@@ -1005,11 +1005,11 @@ struct CSerActionUnserialize
class CSizeComputer
{
protected:
- size_t nSize;
+ size_t nSize{0};
const int nVersion;
public:
- explicit CSizeComputer(int nVersionIn) : nSize(0), nVersion(nVersionIn) {}
+ explicit CSizeComputer(int nVersionIn) : nVersion(nVersionIn) {}
void write(Span<const std::byte> src)
{
diff --git a/src/span.h b/src/span.h
index 4d00bbc244..4692eca7fb 100644
--- a/src/span.h
+++ b/src/span.h
@@ -96,7 +96,7 @@ template<typename C>
class Span
{
C* m_data;
- std::size_t m_size;
+ std::size_t m_size{0};
template <class T>
struct is_Span_int : public std::false_type {};
@@ -107,7 +107,7 @@ class Span
public:
- constexpr Span() noexcept : m_data(nullptr), m_size(0) {}
+ constexpr Span() noexcept : m_data(nullptr) {}
/** Construct a span from a begin pointer and a size.
*
diff --git a/src/streams.h b/src/streams.h
index c12ba8777a..ed9af308c9 100644
--- a/src/streams.h
+++ b/src/streams.h
@@ -628,8 +628,8 @@ private:
const int nVersion;
FILE *src; //!< source file
- uint64_t nSrcPos; //!< how many bytes have been read from source
- uint64_t m_read_pos; //!< how many bytes have been read from this
+ uint64_t nSrcPos{0}; //!< how many bytes have been read from source
+ uint64_t m_read_pos{0}; //!< how many bytes have been read from this
uint64_t nReadLimit; //!< up to which position we're allowed to read
uint64_t nRewind; //!< how many bytes we guarantee to rewind
std::vector<std::byte> vchBuf; //!< the buffer
@@ -675,7 +675,7 @@ private:
public:
CBufferedFile(FILE* fileIn, uint64_t nBufSize, uint64_t nRewindIn, int nTypeIn, int nVersionIn)
- : nType(nTypeIn), nVersion(nVersionIn), nSrcPos(0), m_read_pos(0), nReadLimit(std::numeric_limits<uint64_t>::max()), nRewind(nRewindIn), vchBuf(nBufSize, std::byte{0})
+ : nType(nTypeIn), nVersion(nVersionIn), nReadLimit(std::numeric_limits<uint64_t>::max()), nRewind(nRewindIn), vchBuf(nBufSize, std::byte{0})
{
if (nRewindIn >= nBufSize)
throw std::ios_base::failure("Rewind limit must be less than buffer size");
diff --git a/src/support/lockedpool.cpp b/src/support/lockedpool.cpp
index 8b05743330..24ae4bdd1e 100644
--- a/src/support/lockedpool.cpp
+++ b/src/support/lockedpool.cpp
@@ -280,8 +280,8 @@ size_t PosixLockedPageAllocator::GetLimit()
/*******************************************************************************/
// Implementation: LockedPool
-LockedPool::LockedPool(std::unique_ptr<LockedPageAllocator> allocator_in, LockingFailed_Callback lf_cb_in):
- allocator(std::move(allocator_in)), lf_cb(lf_cb_in), cumulative_bytes_locked(0)
+LockedPool::LockedPool(std::unique_ptr<LockedPageAllocator> allocator_in, LockingFailed_Callback lf_cb_in)
+ : allocator(std::move(allocator_in)), lf_cb(lf_cb_in)
{
}
diff --git a/src/support/lockedpool.h b/src/support/lockedpool.h
index 66fbc218ab..1bba459377 100644
--- a/src/support/lockedpool.h
+++ b/src/support/lockedpool.h
@@ -198,7 +198,7 @@ private:
std::list<LockedPageArena> arenas;
LockingFailed_Callback lf_cb;
- size_t cumulative_bytes_locked;
+ size_t cumulative_bytes_locked{0};
/** Mutex protects access to this pool's data structures, including arenas.
*/
mutable std::mutex mutex;
diff --git a/src/test/util/net.h b/src/test/util/net.h
index 90c606306f..e6506b0d08 100644
--- a/src/test/util/net.h
+++ b/src/test/util/net.h
@@ -103,7 +103,7 @@ constexpr auto ALL_NETWORKS = std::array{
class StaticContentsSock : public Sock
{
public:
- explicit StaticContentsSock(const std::string& contents) : m_contents{contents}, m_consumed{0}
+ explicit StaticContentsSock(const std::string& contents) : m_contents{contents}
{
// Just a dummy number that is not INVALID_SOCKET.
m_socket = INVALID_SOCKET - 1;
@@ -191,7 +191,7 @@ public:
private:
const std::string m_contents;
- mutable size_t m_consumed;
+ mutable size_t m_consumed{0};
};
std::vector<NodeEvictionCandidate> GetRandomNodeEvictionCandidates(int n_candidates, FastRandomContext& random_context);
diff --git a/src/tinyformat.h b/src/tinyformat.h
index 8eded00add..3ec385bc95 100644
--- a/src/tinyformat.h
+++ b/src/tinyformat.h
@@ -508,9 +508,6 @@ class FormatArg
{
public:
FormatArg()
- : m_value(nullptr),
- m_formatImpl(nullptr),
- m_toIntImpl(nullptr)
{ }
template<typename T>
@@ -549,10 +546,10 @@ class FormatArg
return convertToInt<T>::invoke(*static_cast<const T*>(value));
}
- const void* m_value;
+ const void* m_value{nullptr};
void (*m_formatImpl)(std::ostream& out, const char* fmtBegin,
- const char* fmtEnd, int ntrunc, const void* value);
- int (*m_toIntImpl)(const void* value);
+ const char* fmtEnd, int ntrunc, const void* value){nullptr};
+ int (*m_toIntImpl)(const void* value){nullptr};
};
diff --git a/src/torcontrol.cpp b/src/torcontrol.cpp
index b5f1fa7138..ece77f9023 100644
--- a/src/torcontrol.cpp
+++ b/src/torcontrol.cpp
@@ -53,8 +53,8 @@ static const uint16_t DEFAULT_TOR_SOCKS_PORT = 9050;
/****** Low-level TorControlConnection ********/
-TorControlConnection::TorControlConnection(struct event_base *_base):
- base(_base), b_conn(nullptr)
+TorControlConnection::TorControlConnection(struct event_base* _base)
+ : base(_base)
{
}
diff --git a/src/torcontrol.h b/src/torcontrol.h
index 81475aee74..6563a2ef42 100644
--- a/src/torcontrol.h
+++ b/src/torcontrol.h
@@ -93,7 +93,7 @@ private:
/** Libevent event base */
struct event_base *base;
/** Connection to control socket */
- struct bufferevent *b_conn;
+ struct bufferevent* b_conn{nullptr};
/** Message being received */
TorControlReply message;
/** Response handlers */
diff --git a/src/univalue/include/univalue_utffilter.h b/src/univalue/include/univalue_utffilter.h
index f688eaaa30..41d8e6bb05 100644
--- a/src/univalue/include/univalue_utffilter.h
+++ b/src/univalue/include/univalue_utffilter.h
@@ -13,8 +13,8 @@
class JSONUTF8StringFilter
{
public:
- explicit JSONUTF8StringFilter(std::string &s):
- str(s), is_valid(true), codepoint(0), state(0), surpair(0)
+ explicit JSONUTF8StringFilter(std::string& s)
+ : str(s)
{
}
// Write single 8-bit char (may be part of UTF-8 sequence)
@@ -79,10 +79,10 @@ public:
}
private:
std::string &str;
- bool is_valid;
+ bool is_valid{true};
// Current UTF-8 decoding state
- unsigned int codepoint;
- int state; // Top bit to be filled in for next UTF-8 byte, or 0
+ unsigned int codepoint{0};
+ int state{0}; // Top bit to be filled in for next UTF-8 byte, or 0
// Keep track of the following state to handle the following section of
// RFC4627:
@@ -94,7 +94,7 @@ private:
// "\uD834\uDD1E".
//
// Two subsequent \u.... may have to be replaced with one actual codepoint.
- unsigned int surpair; // First half of open UTF-16 surrogate pair, or 0
+ unsigned int surpair{0}; // First half of open UTF-16 surrogate pair, or 0
void append_codepoint(unsigned int codepoint_)
{
diff --git a/src/util/sock.h b/src/util/sock.h
index adcca377e3..6bac2dfd34 100644
--- a/src/util/sock.h
+++ b/src/util/sock.h
@@ -181,9 +181,9 @@ public:
* Auxiliary requested/occurred events to wait for in `WaitMany()`.
*/
struct Events {
- explicit Events(Event req) : requested{req}, occurred{0} {}
+ explicit Events(Event req) : requested{req} {}
Event requested;
- Event occurred;
+ Event occurred{0};
};
struct HashSharedPtrSock {
diff --git a/src/wallet/bdb.cpp b/src/wallet/bdb.cpp
index c619222b3e..653115aa81 100644
--- a/src/wallet/bdb.cpp
+++ b/src/wallet/bdb.cpp
@@ -308,7 +308,7 @@ BerkeleyDatabase::~BerkeleyDatabase()
}
}
-BerkeleyBatch::BerkeleyBatch(BerkeleyDatabase& database, const bool read_only, bool fFlushOnCloseIn) : pdb(nullptr), activeTxn(nullptr), m_database(database)
+BerkeleyBatch::BerkeleyBatch(BerkeleyDatabase& database, const bool read_only, bool fFlushOnCloseIn) : m_database(database)
{
database.AddRef();
database.Open();
diff --git a/src/wallet/bdb.h b/src/wallet/bdb.h
index 9d1d68ba43..06c98972b0 100644
--- a/src/wallet/bdb.h
+++ b/src/wallet/bdb.h
@@ -207,9 +207,9 @@ private:
bool HasKey(DataStream&& key) override;
protected:
- Db* pdb;
+ Db* pdb{nullptr};
std::string strFile;
- DbTxn* activeTxn;
+ DbTxn* activeTxn{nullptr};
bool fReadOnly;
bool fFlushOnClose;
BerkeleyEnvironment *env;
diff --git a/src/wallet/db.h b/src/wallet/db.h
index 287fb1d19e..d4c590fac7 100644
--- a/src/wallet/db.h
+++ b/src/wallet/db.h
@@ -123,7 +123,7 @@ class WalletDatabase
{
public:
/** Create dummy DB handle */
- WalletDatabase() : nUpdateCounter(0), nLastSeen(0), nLastFlushed(0), nLastWalletUpdate(0) {}
+ WalletDatabase() : nUpdateCounter(0) {}
virtual ~WalletDatabase() {};
/** Open the database if it is not already opened. */
@@ -165,9 +165,9 @@ public:
virtual std::string Format() = 0;
std::atomic<unsigned int> nUpdateCounter;
- unsigned int nLastSeen;
- unsigned int nLastFlushed;
- int64_t nLastWalletUpdate;
+ unsigned int nLastSeen{0};
+ unsigned int nLastFlushed{0};
+ int64_t nLastWalletUpdate{0};
/** Make a DatabaseBatch connected to this database */
virtual std::unique_ptr<DatabaseBatch> MakeBatch(bool flush_on_close = true) = 0;
diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h
index 8b7e6dd526..108db11d32 100644
--- a/src/wallet/wallet.h
+++ b/src/wallet/wallet.h
@@ -954,10 +954,10 @@ private:
using Clock = std::chrono::steady_clock;
using NowFn = std::function<Clock::time_point()>;
CWallet& m_wallet;
- bool m_could_reserve;
+ bool m_could_reserve{false};
NowFn m_now;
public:
- explicit WalletRescanReserver(CWallet& w) : m_wallet(w), m_could_reserve(false) {}
+ explicit WalletRescanReserver(CWallet& w) : m_wallet(w) {}
bool reserve()
{
diff --git a/src/zmq/zmqabstractnotifier.h b/src/zmq/zmqabstractnotifier.h
index 6899ee8fa6..cf0ee48f47 100644
--- a/src/zmq/zmqabstractnotifier.h
+++ b/src/zmq/zmqabstractnotifier.h
@@ -20,7 +20,7 @@ class CZMQAbstractNotifier
public:
static const int DEFAULT_ZMQ_SNDHWM {1000};
- CZMQAbstractNotifier() : psocket(nullptr), outbound_message_high_water_mark(DEFAULT_ZMQ_SNDHWM) { }
+ CZMQAbstractNotifier() : outbound_message_high_water_mark(DEFAULT_ZMQ_SNDHWM) {}
virtual ~CZMQAbstractNotifier();
template <typename T>
@@ -57,7 +57,7 @@ public:
virtual bool NotifyTransaction(const CTransaction &transaction);
protected:
- void *psocket;
+ void* psocket{nullptr};
std::string type;
std::string address;
int outbound_message_high_water_mark; // aka SNDHWM
diff --git a/src/zmq/zmqnotificationinterface.cpp b/src/zmq/zmqnotificationinterface.cpp
index 6dc4737d0a..df129c0830 100644
--- a/src/zmq/zmqnotificationinterface.cpp
+++ b/src/zmq/zmqnotificationinterface.cpp
@@ -21,7 +21,7 @@
#include <utility>
#include <vector>
-CZMQNotificationInterface::CZMQNotificationInterface() : pcontext(nullptr)
+CZMQNotificationInterface::CZMQNotificationInterface()
{
}
diff --git a/src/zmq/zmqnotificationinterface.h b/src/zmq/zmqnotificationinterface.h
index b24d4664da..a43f9bfef3 100644
--- a/src/zmq/zmqnotificationinterface.h
+++ b/src/zmq/zmqnotificationinterface.h
@@ -39,7 +39,7 @@ protected:
private:
CZMQNotificationInterface();
- void *pcontext;
+ void* pcontext{nullptr};
std::list<std::unique_ptr<CZMQAbstractNotifier>> notifiers;
};