mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 23:03:45 +01:00
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
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user