diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2023-01-31 11:50:10 +0000 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2023-01-31 11:50:10 +0000 |
commit | 96ee992ac3535848e2dc717bf284339badd40dcb (patch) | |
tree | e7405ed701334a1fcb99c72b5f0301725918f531 /src/wallet | |
parent | 357d750cab5221695d718e6d3e8ce63fa2b5ab3a (diff) |
clang-tidy: Fix `modernize-use-default-member-init` in headers
See https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-default-member-init.html
Diffstat (limited to 'src/wallet')
-rw-r--r-- | src/wallet/bdb.cpp | 2 | ||||
-rw-r--r-- | src/wallet/bdb.h | 4 | ||||
-rw-r--r-- | src/wallet/db.h | 8 | ||||
-rw-r--r-- | src/wallet/wallet.h | 4 |
4 files changed, 9 insertions, 9 deletions
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() { |