Changeset View
Changeset View
Standalone View
Standalone View
src/qt/transactiondesc.cpp
Show All 17 Lines | |||||
#include <validation.h> | #include <validation.h> | ||||
#include <wallet/db.h> | #include <wallet/db.h> | ||||
#include <wallet/finaltx.h> | #include <wallet/finaltx.h> | ||||
#include <wallet/wallet.h> | #include <wallet/wallet.h> | ||||
#include <cstdint> | #include <cstdint> | ||||
#include <string> | #include <string> | ||||
QString TransactionDesc::FormatTxStatus( | QString | ||||
const interfaces::WalletTx &wtx, const interfaces::WalletTxStatus &status, | TransactionDesc::FormatTxStatus(const interfaces::WalletTx &wtx, | ||||
bool inMempool, int numBlocks, int64_t adjustedTime) { | const interfaces::WalletTxStatus &status, | ||||
bool inMempool, int numBlocks) { | |||||
if (!status.is_final) { | if (!status.is_final) { | ||||
if (wtx.tx->nLockTime < LOCKTIME_THRESHOLD) { | if (wtx.tx->nLockTime < LOCKTIME_THRESHOLD) { | ||||
return tr("Open for %n more block(s)", "", | return tr("Open for %n more block(s)", "", | ||||
wtx.tx->nLockTime - numBlocks); | wtx.tx->nLockTime - numBlocks); | ||||
} else { | } else { | ||||
return tr("Open until %1") | return tr("Open until %1") | ||||
.arg(GUIUtil::dateTimeStr(wtx.tx->nLockTime)); | .arg(GUIUtil::dateTimeStr(wtx.tx->nLockTime)); | ||||
} | } | ||||
Show All 14 Lines | if (!status.is_final) { | ||||
} | } | ||||
} | } | ||||
} | } | ||||
QString TransactionDesc::toHTML(interfaces::Node &node, | QString TransactionDesc::toHTML(interfaces::Node &node, | ||||
interfaces::Wallet &wallet, | interfaces::Wallet &wallet, | ||||
TransactionRecord *rec, int unit) { | TransactionRecord *rec, int unit) { | ||||
int numBlocks; | int numBlocks; | ||||
int64_t adjustedTime; | |||||
interfaces::WalletTxStatus status; | interfaces::WalletTxStatus status; | ||||
interfaces::WalletOrderForm orderForm; | interfaces::WalletOrderForm orderForm; | ||||
bool inMempool; | bool inMempool; | ||||
interfaces::WalletTx wtx = wallet.getWalletTxDetails( | interfaces::WalletTx wtx = wallet.getWalletTxDetails( | ||||
rec->txid, status, orderForm, inMempool, numBlocks, adjustedTime); | rec->txid, status, orderForm, inMempool, numBlocks); | ||||
QString strHTML; | QString strHTML; | ||||
strHTML.reserve(4000); | strHTML.reserve(4000); | ||||
strHTML += "<html><font face='verdana, arial, helvetica, sans-serif'>"; | strHTML += "<html><font face='verdana, arial, helvetica, sans-serif'>"; | ||||
int64_t nTime = wtx.time; | int64_t nTime = wtx.time; | ||||
Amount nCredit = wtx.credit; | Amount nCredit = wtx.credit; | ||||
Amount nDebit = wtx.debit; | Amount nDebit = wtx.debit; | ||||
Amount nNet = nCredit - nDebit; | Amount nNet = nCredit - nDebit; | ||||
strHTML += "<b>" + tr("Status") + ":</b> " + | strHTML += "<b>" + tr("Status") + ":</b> " + | ||||
FormatTxStatus(wtx, status, inMempool, numBlocks, adjustedTime); | FormatTxStatus(wtx, status, inMempool, numBlocks); | ||||
strHTML += "<br>"; | strHTML += "<br>"; | ||||
strHTML += "<b>" + tr("Date") + ":</b> " + | strHTML += "<b>" + tr("Date") + ":</b> " + | ||||
(nTime ? GUIUtil::dateTimeStr(nTime) : "") + "<br>"; | (nTime ? GUIUtil::dateTimeStr(nTime) : "") + "<br>"; | ||||
// | // | ||||
// From | // From | ||||
// | // | ||||
▲ Show 20 Lines • Show All 312 Lines • Show Last 20 Lines |