diff options
author | Jeff Garzik <jgarzik@bitpay.com> | 2014-06-03 12:55:33 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@bitpay.com> | 2014-06-03 12:55:33 -0400 |
commit | d04fd3e2afaf9cdab21aa8f3abb5a5a2c48118cc (patch) | |
tree | 863ca6202a1d1b575d87a18becf9ed7d5e8e2f21 /src | |
parent | 06a4334a2f78d9c742709455f945c12f721b5927 (diff) |
CWallet: fix nTimeFirstKey init, by making constructor init common code
Don't repeat yourself etc.
Diffstat (limited to 'src')
-rw-r--r-- | src/wallet.h | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/wallet.h b/src/wallet.h index d9d071c2b9..8e2917188a 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -143,27 +143,26 @@ public: CWallet() { - nWalletVersion = FEATURE_BASE; - nWalletMaxVersion = FEATURE_BASE; - fFileBacked = false; - nMasterKeyMaxID = 0; - pwalletdbEncryption = NULL; - nOrderPosNext = 0; - nNextResend = 0; - nLastResend = 0; - nTimeFirstKey = 0; + SetNull(); } CWallet(std::string strWalletFileIn) { - nWalletVersion = FEATURE_BASE; - nWalletMaxVersion = FEATURE_BASE; + SetNull(); + strWalletFile = strWalletFileIn; fFileBacked = true; + } + void SetNull() + { + nWalletVersion = FEATURE_BASE; + nWalletMaxVersion = FEATURE_BASE; + fFileBacked = false; nMasterKeyMaxID = 0; pwalletdbEncryption = NULL; nOrderPosNext = 0; nNextResend = 0; nLastResend = 0; + nTimeFirstKey = 0; } std::map<uint256, CWalletTx> mapWallet; |