Permalink
Browse files

CWallet: fix nTimeFirstKey init, by making constructor init common code

Also change S4C Address var name
  • Loading branch information...
Tranz5 committed Jul 23, 2014
1 parent 0435cfb commit 0ca28898db4364926f937ca898c0916a243e8b89
Showing with 17 additions and 25 deletions.
  1. +2 −2 src/qt/walletmodel.cpp
  2. +2 −2 src/rpcwallet.cpp
  3. +2 −2 src/wallet.cpp
  4. +11 −19 src/wallet.h
View
@@ -376,10 +376,10 @@ int WalletModel::getStakeForCharityPercent()
QString WalletModel::getStakeForCharityAddress()
{
if (!wallet->StakeForCharityAddress.IsValid())
if (!wallet->strStakeForCharityAddress.IsValid())
return "Not Giving";
else
return wallet->StakeForCharityAddress.ToString().c_str();
return wallet->strStakeForCharityAddress.ToString().c_str();
}
bool WalletModel::dumpWallet(const QString &filename)
View
@@ -246,7 +246,7 @@ Value stakeforcharity(CWallet *pWallet, const Array &params, bool fHelp)
if(nPer == 0)
{
pWallet->fStakeForCharity = false;
pWallet->StakeForCharityAddress = "";
pWallet->strStakeForCharityAddress = "";
pWallet->nStakeForCharityPercent = 0;
return Value::null;
}
@@ -256,7 +256,7 @@ Value stakeforcharity(CWallet *pWallet, const Array &params, bool fHelp)
nPer = 50;
// Future: These will be an array of addr/per/wallet
pWallet->StakeForCharityAddress = address;
pWallet->strStakeForCharityAddress = address;
pWallet->nStakeForCharityPercent = nPer;
pWallet->fStakeForCharity = true;
fGlobalStakeForCharity = true;
View
@@ -1207,8 +1207,8 @@ bool CWallet::StakeForCharity ()
return false;
}
printf("StakeForCharity Sending: %s to Address: %s\n", FormatMoney(nNet).c_str(), StakeForCharityAddress.ToString().c_str());
SendMoneyToDestination(StakeForCharityAddress.Get(), nNet, wtx, false, true);
printf("StakeForCharity Sending: %s to Address: %s\n", FormatMoney(nNet).c_str(), strStakeForCharityAddress.ToString().c_str());
SendMoneyToDestination(strStakeForCharityAddress.Get(), nNet, wtx, false, true);
}
}
View
@@ -113,7 +113,7 @@ class CWallet : public CCryptoKeyStore
bool fWalletUnlockMintOnly;
bool fStakeForCharity;
int nStakeForCharityPercent;
CBitcoinAddress StakeForCharityAddress;
CBitcoinAddress strStakeForCharityAddress;
std::string strWalletFile;
int64 nReserveBalance;
@@ -129,39 +129,31 @@ class CWallet : public CCryptoKeyStore
CWallet()
{
lockJob.SetWallet(this);
nLockTime = 0;
strLockTime = "Locked";
nWalletVersion = FEATURE_BASE;
nWalletMaxVersion = FEATURE_BASE;
fFileBacked = false;
nMasterKeyMaxID = 0;
pwalletdbEncryption = NULL;
nOrderPosNext = 0;
fWalletUnlockMintOnly = false;
fStakeForCharity = false;
nStakeForCharityPercent = 0;
StakeForCharityAddress = "";
nReserveBalance = 0;
SetNull();
}
CWallet(std::string strWalletFileIn)
{
SetNull();
strWalletFile = strWalletFileIn;
fFileBacked = true;
}
void SetNull()
{
lockJob.SetWallet(this);
nLockTime = 0;
strLockTime = "Locked";
nWalletVersion = FEATURE_BASE;
nWalletMaxVersion = FEATURE_BASE;
strWalletFile = strWalletFileIn;
fFileBacked = true;
fFileBacked = false;
nMasterKeyMaxID = 0;
pwalletdbEncryption = NULL;
nOrderPosNext = 0;
fWalletUnlockMintOnly = false;
fStakeForCharity = false;
nStakeForCharityPercent = 0;
StakeForCharityAddress = "";
strStakeForCharityAddress = "";
nReserveBalance = 0;
}
~CWallet() { CWalletDB::UnloadWallet(this); }

0 comments on commit 0ca2889

Please sign in to comment.