Merge pull request #4282 from jgarzik/fix-wallet-init

CWallet: fix nTimeFirstKey init, by making constructor init common code
This commit is contained in:
Jeff Garzik 2014-06-04 15:00:58 -04:00
commit b8ac6cdf53

View file

@ -142,6 +142,17 @@ public:
unsigned int nMasterKeyMaxID; unsigned int nMasterKeyMaxID;
CWallet() CWallet()
{
SetNull();
}
CWallet(std::string strWalletFileIn)
{
SetNull();
strWalletFile = strWalletFileIn;
fFileBacked = true;
}
void SetNull()
{ {
nWalletVersion = FEATURE_BASE; nWalletVersion = FEATURE_BASE;
nWalletMaxVersion = FEATURE_BASE; nWalletMaxVersion = FEATURE_BASE;
@ -153,18 +164,6 @@ public:
nLastResend = 0; nLastResend = 0;
nTimeFirstKey = 0; nTimeFirstKey = 0;
} }
CWallet(std::string strWalletFileIn)
{
nWalletVersion = FEATURE_BASE;
nWalletMaxVersion = FEATURE_BASE;
strWalletFile = strWalletFileIn;
fFileBacked = true;
nMasterKeyMaxID = 0;
pwalletdbEncryption = NULL;
nOrderPosNext = 0;
nNextResend = 0;
nLastResend = 0;
}
std::map<uint256, CWalletTx> mapWallet; std::map<uint256, CWalletTx> mapWallet;