diff options
author | Gregory Maxwell <greg@xiph.org> | 2012-08-23 16:31:45 -0700 |
---|---|---|
committer | Gregory Maxwell <greg@xiph.org> | 2012-08-23 16:31:45 -0700 |
commit | 0050cf21ce2a3a3c032817e661f813ccaf25f430 (patch) | |
tree | 1cd125441785b823b1a87bba9d10c407943f6864 /src/wallet.cpp | |
parent | 1bcd3f26c022f7a2fcc1a01df6d9cae0cb13f8d7 (diff) | |
parent | e07c8e9123aa87b7d49c08a7558ea5af63bfcb74 (diff) |
Merge pull request #1409 from luke-jr/listtx_generate_fold
Treat generation (mined) transactions less different from receive transactions
Diffstat (limited to 'src/wallet.cpp')
-rw-r--r-- | src/wallet.cpp | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/src/wallet.cpp b/src/wallet.cpp index 07a5047cef..5ca501b1af 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -601,23 +601,14 @@ int CWalletTx::GetRequestCount() const return nRequests; } -void CWalletTx::GetAmounts(int64& nGeneratedImmature, int64& nGeneratedMature, list<pair<CTxDestination, int64> >& listReceived, +void CWalletTx::GetAmounts(list<pair<CTxDestination, int64> >& listReceived, list<pair<CTxDestination, int64> >& listSent, int64& nFee, string& strSentAccount) const { - nGeneratedImmature = nGeneratedMature = nFee = 0; + nFee = 0; listReceived.clear(); listSent.clear(); strSentAccount = strFromAccount; - if (IsCoinBase()) - { - if (GetBlocksToMaturity() > 0) - nGeneratedImmature = pwallet->GetCredit(*this); - else - nGeneratedMature = GetCredit(); - return; - } - // Compute fee: int64 nDebit = GetDebit(); if (nDebit > 0) // debit>0 means we signed/sent this transaction @@ -650,20 +641,17 @@ void CWalletTx::GetAmounts(int64& nGeneratedImmature, int64& nGeneratedMature, l } -void CWalletTx::GetAccountAmounts(const string& strAccount, int64& nGenerated, int64& nReceived, +void CWalletTx::GetAccountAmounts(const string& strAccount, int64& nReceived, int64& nSent, int64& nFee) const { - nGenerated = nReceived = nSent = nFee = 0; + nReceived = nSent = nFee = 0; - int64 allGeneratedImmature, allGeneratedMature, allFee; - allGeneratedImmature = allGeneratedMature = allFee = 0; + int64 allFee; string strSentAccount; list<pair<CTxDestination, int64> > listReceived; list<pair<CTxDestination, int64> > listSent; - GetAmounts(allGeneratedImmature, allGeneratedMature, listReceived, listSent, allFee, strSentAccount); + GetAmounts(listReceived, listSent, allFee, strSentAccount); - if (strAccount == "") - nGenerated = allGeneratedMature; if (strAccount == strSentAccount) { BOOST_FOREACH(const PAIRTYPE(CTxDestination,int64)& s, listSent) |