Use a typedef for monetary values
This commit is contained in:
committed by
Mark Friedenbach
parent
64cfaf891f
commit
a372168e77
@@ -32,9 +32,9 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const CWallet *
|
||||
{
|
||||
QList<TransactionRecord> parts;
|
||||
int64_t nTime = wtx.GetTxTime();
|
||||
int64_t nCredit = wtx.GetCredit(true);
|
||||
int64_t nDebit = wtx.GetDebit(ISMINE_ALL);
|
||||
int64_t nNet = nCredit - nDebit;
|
||||
CAmount nCredit = wtx.GetCredit(true);
|
||||
CAmount nDebit = wtx.GetDebit(ISMINE_ALL);
|
||||
CAmount nNet = nCredit - nDebit;
|
||||
uint256 hash = wtx.GetHash();
|
||||
std::map<std::string, std::string> mapValue = wtx.mapValue;
|
||||
|
||||
@@ -97,7 +97,7 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const CWallet *
|
||||
if (fAllFromMe && fAllToMe)
|
||||
{
|
||||
// Payment to self
|
||||
int64_t nChange = wtx.GetChange();
|
||||
CAmount nChange = wtx.GetChange();
|
||||
|
||||
parts.append(TransactionRecord(hash, nTime, TransactionRecord::SendToSelf, "",
|
||||
-(nDebit - nChange), nCredit - nChange));
|
||||
@@ -108,7 +108,7 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const CWallet *
|
||||
//
|
||||
// Debit
|
||||
//
|
||||
int64_t nTxFee = nDebit - wtx.GetValueOut();
|
||||
CAmount nTxFee = nDebit - wtx.GetValueOut();
|
||||
|
||||
for (unsigned int nOut = 0; nOut < wtx.vout.size(); nOut++)
|
||||
{
|
||||
@@ -138,7 +138,7 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const CWallet *
|
||||
sub.address = mapValue["to"];
|
||||
}
|
||||
|
||||
int64_t nValue = txout.nValue;
|
||||
CAmount nValue = txout.nValue;
|
||||
/* Add fee to first output */
|
||||
if (nTxFee > 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user