From 51ed9ec971614aebdbfbd9527aba365dd0afd437 Mon Sep 17 00:00:00 2001 From: Brandon Dahler Date: Sat, 13 Apr 2013 00:13:08 -0500 Subject: Cleanup code using forward declarations. Use misc methods of avoiding unnecesary header includes. Replace int typedefs with int##_t from stdint.h. Replace PRI64[xdu] with PRI[xdu]64 from inttypes.h. Normalize QT_VERSION ifs where possible. Resolve some indirect dependencies as direct ones. Remove extern declarations from .cpp files. --- src/qt/transactionrecord.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'src/qt/transactionrecord.cpp') diff --git a/src/qt/transactionrecord.cpp b/src/qt/transactionrecord.cpp index c488e2d21c..675daa9c9c 100644 --- a/src/qt/transactionrecord.cpp +++ b/src/qt/transactionrecord.cpp @@ -4,8 +4,10 @@ #include "transactionrecord.h" -#include "wallet.h" #include "base58.h" +#include "wallet.h" + +#include /* Return positive answer if transaction should be shown in list. */ @@ -28,10 +30,10 @@ bool TransactionRecord::showTransaction(const CWalletTx &wtx) QList TransactionRecord::decomposeTransaction(const CWallet *wallet, const CWalletTx &wtx) { QList parts; - int64 nTime = wtx.GetTxTime(); - int64 nCredit = wtx.GetCredit(true); - int64 nDebit = wtx.GetDebit(); - int64 nNet = nCredit - nDebit; + int64_t nTime = wtx.GetTxTime(); + int64_t nCredit = wtx.GetCredit(true); + int64_t nDebit = wtx.GetDebit(); + int64_t nNet = nCredit - nDebit; uint256 hash = wtx.GetHash(); std::map mapValue = wtx.mapValue; @@ -83,7 +85,7 @@ QList TransactionRecord::decomposeTransaction(const CWallet * if (fAllFromMe && fAllToMe) { // Payment to self - int64 nChange = wtx.GetChange(); + int64_t nChange = wtx.GetChange(); parts.append(TransactionRecord(hash, nTime, TransactionRecord::SendToSelf, "", -(nDebit - nChange), nCredit - nChange)); @@ -93,7 +95,7 @@ QList TransactionRecord::decomposeTransaction(const CWallet * // // Debit // - int64 nTxFee = nDebit - GetValueOut(wtx); + int64_t nTxFee = nDebit - GetValueOut(wtx); for (unsigned int nOut = 0; nOut < wtx.vout.size(); nOut++) { @@ -122,7 +124,7 @@ QList TransactionRecord::decomposeTransaction(const CWallet * sub.address = mapValue["to"]; } - int64 nValue = txout.nValue; + int64_t nValue = txout.nValue; /* Add fee to first output */ if (nTxFee > 0) { @@ -198,7 +200,7 @@ void TransactionRecord::updateStatus(const CWalletTx &wtx) // For generated transactions, determine maturity if(type == TransactionRecord::Generated) { - int64 nCredit = wtx.GetCredit(true); + int64_t nCredit = wtx.GetCredit(true); if (nCredit == 0) { status.maturity = TransactionStatus::Immature; -- cgit v1.2.3