aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet.h
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2019-01-09 14:59:57 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2019-01-09 15:04:36 +0100
commit3f125151998d9fead198fd44243dd64006b5a56b (patch)
treef6945556ab446cece8c3310c37e30d91ff66c6fc /src/wallet/wallet.h
parente12a480e40753655124acc15fe4ebfe7bcb3ab99 (diff)
parentfa2510d5c1cdf9c2cd5cc9887302ced4378c7202 (diff)
Merge #15109: refactor: Use C++11 default member initializers
fa2510d5c1cdf9c2cd5cc9887302ced4378c7202 Use C++11 default member initializers (MarcoFalke) Pull request description: Changes: * Remove unused constructors that leave some members uninitialized * Remove manual initialization in each constructor and prefer C++11 default member initializers This is not a stylistic change, but a change that avoids bugs such as: * fix uninitialized read when stringifying an addrLocal #14728 * qt: Initialize members in WalletModel #12426 * net: correctly initialize nMinPingUsecTime #6636 * ... Tree-SHA512: 0f896f3b9fcc464d5fc7525f7c86343ef9ce9fb13425fbc68e9a9728fd8710c2b4e2fd039ee08279ea41ff20fd92b7185cf5cca95a0bcb6a5340a1e6f03cae6b
Diffstat (limited to 'src/wallet/wallet.h')
-rw-r--r--src/wallet/wallet.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h
index 95a2c833f8..3a3ec43c9b 100644
--- a/src/wallet/wallet.h
+++ b/src/wallet/wallet.h
@@ -1178,18 +1178,16 @@ class CReserveKey final : public CReserveScript
{
protected:
CWallet* pwallet;
- int64_t nIndex;
+ int64_t nIndex{-1};
CPubKey vchPubKey;
- bool fInternal;
+ bool fInternal{false};
+
public:
explicit CReserveKey(CWallet* pwalletIn)
{
- nIndex = -1;
pwallet = pwalletIn;
- fInternal = false;
}
- CReserveKey() = default;
CReserveKey(const CReserveKey&) = delete;
CReserveKey& operator=(const CReserveKey&) = delete;