From 7ccadd41999c40a459655da3c66ff78c2f86c773 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Tue, 3 Jun 2014 12:55:33 -0400 Subject: CWallet: fix nTimeFirstKey init, by making constructor init common code Don't repeat yourself etc. Rebased-From: d04fd3e Rebased-By: Wladimir J. van der Laan --- src/wallet.h | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/wallet.h b/src/wallet.h index 5a9b7ad8fd..88ee87196b 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 mapWallet; -- cgit v1.2.3