aboutsummaryrefslogtreecommitdiff
path: root/src/wallet.cpp
diff options
context:
space:
mode:
authorLuke Dashjr <luke-jr+git@utopios.org>2012-06-02 02:33:28 +0000
committerLuke Dashjr <luke-jr+git@utopios.org>2012-08-23 23:20:01 +0000
commite07c8e9123aa87b7d49c08a7558ea5af63bfcb74 (patch)
tree1cd125441785b823b1a87bba9d10c407943f6864 /src/wallet.cpp
parent1bcd3f26c022f7a2fcc1a01df6d9cae0cb13f8d7 (diff)
downloadbitcoin-e07c8e9123aa87b7d49c08a7558ea5af63bfcb74.tar.xz
Treat generation (mined) transactions less different from receive transactions
- Show address receiving the generation, and include it in the correct "account" - Multiple entries in listtransactions output if the coinbase has multiple outputs to us
Diffstat (limited to 'src/wallet.cpp')
-rw-r--r--src/wallet.cpp24
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)