15 #include "validation.h" 40 if (nDepth < 0)
return tr(
"conflicted");
46 strTxStatus = tr(
"%1/offline").arg(nDepth);
47 }
else if (nDepth == 0) {
48 strTxStatus = tr(
"0/unconfirmed, %1").arg((wtx.
InMempool() ? tr(
"in memory pool") : tr(
"not in memory pool"))) + (wtx.
isAbandoned() ?
", "+tr(
"abandoned") :
"");
49 }
else if (nDepth < 6) {
50 strTxStatus = tr(
"%1/unconfirmed").arg(nDepth);
52 strTxStatus = tr(
"%1 confirmations").arg(nDepth);
62 strTxStatus += tr(
"verified via InstantSend");
64 strTxStatus += tr(
"InstantSend verification in progress - %1 of %2 signatures").arg(nSignatures).arg(nSignaturesMax);
66 strTxStatus += tr(
"InstantSend verification failed");
79 strHTML.reserve(4000);
80 strHTML +=
"<html><font face='verdana, arial, helvetica, sans-serif'>";
85 CAmount nNet = nCredit - nDebit;
92 strHTML += tr(
", has not been successfully broadcast yet");
93 else if (nRequests > 0)
94 strHTML += tr(
", broadcast through %n node(s)",
"", nRequests);
105 strHTML +=
"<b>" + tr(
"Source") +
":</b> " + tr(
"Generated") +
"<br>";
121 if (
wallet->mapAddressBook.count(address))
123 strHTML +=
"<b>" + tr(
"From") +
":</b> " + tr(
"unknown") +
"<br>";
124 strHTML +=
"<b>" + tr(
"To") +
":</b> ";
127 if (!
wallet->mapAddressBook[address].name.empty())
128 strHTML +=
" (" + addressOwned +
", " + tr(
"label") +
": " +
GUIUtil::HtmlEscape(
wallet->mapAddressBook[address].name) +
")";
130 strHTML +=
" (" + addressOwned +
")";
143 std::string strAddress = wtx.
mapValue[
"to"];
144 strHTML +=
"<b>" + tr(
"To") +
":</b> ";
146 if (
wallet->mapAddressBook.count(dest) && !
wallet->mapAddressBook[dest].name.empty())
162 strHTML +=
"<b>" + tr(
"Credit") +
":</b> ";
166 strHTML +=
"(" + tr(
"not accepted") +
")";
179 BOOST_FOREACH(
const CTxIn& txin, wtx.
vin)
182 if(fAllFromMe > mine) fAllFromMe = mine;
189 if(fAllToMe > mine) fAllToMe = mine;
195 strHTML +=
"<b>" + tr(
"From") +
":</b> " + tr(
"watch-only") +
"<br>";
213 strHTML +=
"<b>" + tr(
"To") +
":</b> ";
214 if (
wallet->mapAddressBook.count(address) && !
wallet->mapAddressBook[address].name.empty())
218 strHTML +=
" (own address)";
220 strHTML +=
" (watch-only)";
234 CAmount nValue = nCredit - nChange;
248 BOOST_FOREACH(
const CTxIn& txin, wtx.
vin)
252 if (
wallet->IsMine(txout))
268 strHTML +=
"<b>" + tr(
"Transaction total size") +
":</b> " + QString::number(wtx.
GetTotalSize()) +
" bytes<br>";
272 if (r.first ==
"Message")
273 strHTML +=
"<br><b>" + tr(
"Message") +
":</b><br>" +
GUIUtil::HtmlEscape(r.second,
true) +
"<br>";
280 if (r.first ==
"PaymentRequest")
283 req.
parse(QByteArray::fromRawData(r.second.data(), r.second.size()));
293 strHTML +=
"<br>" + tr(
"Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to \"not accepted\" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.").arg(QString::number(numBlocksToMaturity)) +
"<br>";
301 strHTML +=
"<hr><br>" + tr(
"Debug information") +
"<br><br>";
302 BOOST_FOREACH(
const CTxIn& txin, wtx.
vin)
309 strHTML +=
"<br><b>" + tr(
"Transaction") +
":</b><br>";
312 strHTML +=
"<br><b>" + tr(
"Inputs") +
":</b>";
315 BOOST_FOREACH(
const CTxIn& txin, wtx.
vin)
322 if (prevout.
n < prev.
vout.size())
329 if (
wallet->mapAddressBook.count(address) && !
wallet->mapAddressBook[address].name.empty())
331 strHTML += QString::fromStdString(
CBitcoinAddress(address).ToString());
335 strHTML = strHTML +
" IsWatchOnly=" + (
wallet->IsMine(vout) &
ISMINE_WATCH_ONLY ? tr(
"true") : tr(
"false")) +
"</li>";
343 strHTML +=
"</font></html>";
CAmount GetCredit(const isminefilter &filter) const
boost::variant< CNoDestination, CKeyID, CScriptID > CTxDestination
bool ExtractDestination(const CScript &scriptPubKey, CTxDestination &addressRet)
bool GetCoins(const uint256 &txid, CCoins &coins) const
Retrieve the CCoins (unspent transaction outputs) for a given txid.
bool IsTxLockCandidateTimedOut(const uint256 &txHash)
isminetype IsMine(const CKeyStore &keystore, const CTxDestination &dest)
bool parse(const QByteArray &data)
static const int COINBASE_MATURITY
static X509_STORE * getCertStore()
CAmount GetValueOut() const
unsigned int nTimeReceived
CAmount GetChange() const
bool IsInMainChain() const
#define AssertLockHeld(cs)
static QString formatHtmlWithUnit(int unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=separatorStandard)
Format as HTML string (with unit)
CCoinsViewCache * pcoinsTip
std::vector< CTxOut > vout
unspent transaction outputs; spent outputs are .IsNull(); spent outputs at the end of the array are d...
unsigned int GetTotalSize() const
bool CheckFinalTx(const CTransaction &tx, int flags)
int GetTransactionLockSignatures(const uint256 &txHash)
bool getMerchant(X509_STORE *certStore, QString &merchant) const
static QString toHTML(CWallet *wallet, CWalletTx &wtx, TransactionRecord *rec, int unit)
static QString FormatTxStatus(const CWalletTx &wtx)
int64_t GetTxTime() const
QString HtmlEscape(const QString &str, bool fMultiLine)
CAmount GetDebit(const isminefilter &filter) const
filter decides which addresses will count towards the debit
std::vector< std::pair< std::string, std::string > > vOrderForm
bool IsLockedInstantSendTransaction(const uint256 &txHash)
const std::vector< CTxIn > vin
CTxDestination Get() const
static QString formatSubTxId(const uint256 &hash, int vout)
const uint256 & GetHash() const
int64_t GetAdjustedTime()
std::string ToString() const
const std::vector< CTxOut > vout
bool HasTxLockRequest(const uint256 &txHash)
static const unsigned int LOCKTIME_THRESHOLD
int GetMaxSignatures() const
int GetBlocksToMaturity() const
int GetDepthInMainChain(const CBlockIndex *&pindexRet, bool enableIX=true) const
int GetRequestCount() const
QString dateTimeStr(const QDateTime &date)