X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Fqt%2Ftransactiondesc.cpp;h=32102c21d38c3694d62d2c677369c178b6d393c7;hb=HEAD;hp=403362178115bc34c8a0a5fd0177ea87d63c29c8;hpb=77a43545b4491b9703d803765da9059d2bdd5aaa;p=novacoin.git diff --git a/src/qt/transactiondesc.cpp b/src/qt/transactiondesc.cpp index 4033621..32102c2 100644 --- a/src/qt/transactiondesc.cpp +++ b/src/qt/transactiondesc.cpp @@ -1,12 +1,10 @@ #include "transactiondesc.h" - #include "guiutil.h" #include "bitcoinunits.h" - #include "main.h" #include "wallet.h" -#include "txdb.h" -#include "ui_interface.h" +#include "txdb-leveldb.h" +#include "interface.h" #include "base58.h" #include @@ -78,7 +76,7 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx) if (nNet > 0) { // Credit - BOOST_FOREACH(const CTxOut& txout, wtx.vout) + for (const CTxOut& txout : wtx.vout) { if (wallet->IsMine(txout)) { @@ -142,9 +140,9 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx) // Online transaction std::string strAddress = wtx.mapValue["to"]; strHTML += "" + tr("To") + ": "; - CTxDestination dest = CBitcoinAddress(strAddress).Get(); - if (wallet->mapAddressBook.count(dest) && !wallet->mapAddressBook[dest].empty()) - strHTML += GUIUtil::HtmlEscape(wallet->mapAddressBook[dest]) + " "; + CBitcoinAddress addr(strAddress); + if (wallet->mapAddressBook.count(addr) && !wallet->mapAddressBook[addr].empty()) + strHTML += GUIUtil::HtmlEscape(wallet->mapAddressBook[addr]) + " "; strHTML += GUIUtil::HtmlEscape(strAddress) + "
"; } @@ -157,7 +155,7 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx) // Coinbase // int64_t nUnmatured = 0; - BOOST_FOREACH(const CTxOut& txout, wtx.vout) + for (const CTxOut& txout : wtx.vout) nUnmatured += wallet->GetCredit(txout, MINE_ALL); strHTML += "" + tr("Credit") + ": "; if (wtx.IsInMainChain()) @@ -176,11 +174,11 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx) else { bool fAllFromMe = true; - BOOST_FOREACH(const CTxIn& txin, wtx.vin) + for (const CTxIn& txin : wtx.vin) fAllFromMe = fAllFromMe && wallet->IsMine(txin); bool fAllToMe = true; - BOOST_FOREACH(const CTxOut& txout, wtx.vout) + for (const CTxOut& txout : wtx.vout) fAllToMe = fAllToMe && wallet->IsMine(txout); if (fAllFromMe) @@ -188,7 +186,7 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx) // // Debit // - BOOST_FOREACH(const CTxOut& txout, wtx.vout) + for (const CTxOut& txout : wtx.vout) { if (wallet->IsMine(txout)) continue; @@ -228,10 +226,10 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx) // // Mixed debit transaction // - BOOST_FOREACH(const CTxIn& txin, wtx.vin) + for (const CTxIn& txin : wtx.vin) if (wallet->IsMine(txin)) strHTML += "" + tr("Debit") + ": " + BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, -wallet->GetDebit(txin, MINE_ALL)) + "
"; - BOOST_FOREACH(const CTxOut& txout, wtx.vout) + for (const CTxOut& txout : wtx.vout) if (wallet->IsMine(txout)) strHTML += "" + tr("Credit") + ": " + BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, wallet->GetCredit(txout, MINE_ALL)) + "
"; } @@ -258,10 +256,10 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx) if (fDebug) { strHTML += "

" + tr("Debug information") + "

"; - BOOST_FOREACH(const CTxIn& txin, wtx.vin) + for (const CTxIn& txin : wtx.vin) if(wallet->IsMine(txin)) strHTML += "" + tr("Debit") + ": " + BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, -wallet->GetDebit(txin, MINE_ALL)) + "
"; - BOOST_FOREACH(const CTxOut& txout, wtx.vout) + for (const CTxOut& txout : wtx.vout) if(wallet->IsMine(txout)) strHTML += "" + tr("Credit") + ": " + BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, wallet->GetCredit(txout, MINE_ALL)) + "
"; @@ -275,7 +273,7 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx) { LOCK(wallet->cs_wallet); - BOOST_FOREACH(const CTxIn& txin, wtx.vin) + for (const CTxIn& txin : wtx.vin) { COutPoint prevout = txin.prevout;