6#include <config/bitcoin-config.h>
23#include <validation.h>
35 return tr(
"conflicted with a transaction with %1 confirmations")
37 }
else if (nDepth == 0) {
38 return tr(
"0/unconfirmed, %1")
40 :
tr(
"not in memory pool"))) +
42 }
else if (nDepth < 6) {
43 return tr(
"%1/unconfirmed").arg(nDepth);
45 return tr(
"%1 confirmations").arg(nDepth);
54 if (
pr.find(std::string({0x12, 0x0b}) +
"x509+sha256") !=
56 pr.find(std::string({0x12, 0x09}) +
"x509+sha1") != std::string::npos) {
62 size_t cn_pos =
pr.find({0x06, 0x03, 0x55, 0x04, 0x03});
63 if (
cn_pos != std::string::npos) {
65 if (
cn_pos != std::string::npos) {
94 strHTML +=
"<html><font face='verdana, arial, helvetica, sans-serif'>";
101 strHTML +=
"<b>" +
tr(
"Status") +
":</b> " +
105 strHTML +=
"<b>" +
tr(
"Date") +
":</b> " +
112 strHTML +=
"<b>" +
tr(
"Source") +
":</b> " +
tr(
"Generated") +
"<br>";
115 strHTML +=
"<b>" +
tr(
"From") +
":</b> " +
129 "<b>" +
tr(
"From") +
":</b> " +
tr(
"unknown") +
"<br>";
173 for (
const CTxOut &txout : wtx.
tx->vout) {
176 strHTML +=
"<b>" +
tr(
"Credit") +
":</b> ";
180 tr(
"matures in %n more block(s)",
"",
184 strHTML +=
"(" +
tr(
"not accepted") +
")";
191 strHTML +=
"<b>" +
tr(
"Credit") +
":</b> " +
211 "<b>" +
tr(
"From") +
":</b> " +
tr(
"watch-only") +
"<br>";
218 for (
const CTxOut &txout : wtx.
tx->vout) {
250 "<b>" +
tr(
"Debit") +
":</b> " +
255 "<b>" +
tr(
"Credit") +
":</b> " +
265 strHTML +=
"<b>" +
tr(
"Total debit") +
":</b> " +
268 strHTML +=
"<b>" +
tr(
"Total credit") +
":</b> " +
275 strHTML +=
"<b>" +
tr(
"Transaction fee") +
":</b> " +
284 for (
const CTxIn &
txin : wtx.
tx->vin) {
286 strHTML +=
"<b>" +
tr(
"Debit") +
":</b> " +
293 for (
const CTxOut &txout : wtx.
tx->vout) {
295 strHTML +=
"<b>" +
tr(
"Credit") +
":</b> " +
304 strHTML +=
"<b>" +
tr(
"Net amount") +
":</b> " +
311 strHTML +=
"<br><b>" +
tr(
"Message") +
":</b><br>" +
315 strHTML +=
"<br><b>" +
tr(
"Comment") +
":</b><br>" +
319 "<b>" +
tr(
"Transaction ID") +
":</b> " +
rec->getTxID() +
"<br>";
320 strHTML +=
"<b>" +
tr(
"Transaction total size") +
":</b> " +
321 QString::number(wtx.
tx->GetTotalSize()) +
" bytes<br>";
322 strHTML +=
"<b>" +
tr(
"Output index") +
":</b> " +
323 QString::number(
rec->getOutputIndex()) +
"<br>";
326 for (
const std::pair<std::string, std::string> &r :
orderForm) {
327 if (r.first ==
"Message") {
328 strHTML +=
"<br><b>" +
tr(
"Message") +
":</b><br>" +
335 if (r.first ==
"PaymentRequest") {
340 QByteArray::fromRawData(r.second.data(), r.second.size()));
348 merchant +=
tr(
" (Certificate was not verified)");
352 strHTML +=
"<b>" +
tr(
"Merchant") +
":</b> " +
362 tr(
"Generated coins must mature %1 blocks before they can be "
363 "spent. When you generated this block, it was broadcast to the "
364 "network to be added to the block chain. If it fails to get "
365 "into the chain, its state will change to \"not accepted\" and "
366 "it won't be spendable. This may occasionally happen if another "
367 "node generates a block within a few seconds of yours.")
376 strHTML +=
"<hr><br>" +
tr(
"Debug information") +
"<br><br>";
377 for (
const CTxIn &
txin : wtx.
tx->vin) {
379 strHTML +=
"<b>" +
tr(
"Debit") +
":</b> " +
385 for (
const CTxOut &txout : wtx.
tx->vout) {
386 if (
wallet.txoutIsMine(txout)) {
387 strHTML +=
"<b>" +
tr(
"Credit") +
":</b> " +
394 strHTML +=
"<br><b>" +
tr(
"Transaction") +
":</b><br>";
397 strHTML +=
"<br><b>" +
tr(
"Inputs") +
":</b>";
400 for (
const CTxIn &
txin : wtx.
tx->vin) {
401 COutPoint prevout =
txin.prevout;
404 if (
node.getUnspentOutput(prevout,
prev)) {
416 strHTML += QString::fromStdString(
std::string EncodeCashAddr(const CTxDestination &dst, const CChainParams ¶ms)
bool GetBoolArg(const std::string &strArg, bool fDefault) const
Return boolean argument or default value.
static QString formatHtmlWithUnit(int unit, const Amount amount, bool plussign=false, SeparatorStyle separators=SeparatorStyle::STANDARD)
Format as HTML string (with unit)
An output of a transaction.
bool getMerchant(X509_STORE *certStore, QString &merchant) const
bool parse(const QByteArray &data)
static QString toHTML(interfaces::Node &node, interfaces::Wallet &wallet, TransactionRecord *rec, int unit)
static QString FormatTxStatus(const interfaces::WalletTx &wtx, const interfaces::WalletTxStatus &status, bool inMempool, int numBlocks)
UI model for a transaction.
Top-level interface for a bitcoin node (bitcoind process).
Interface for accessing a wallet.
static const int COINBASE_MATURITY
Coinbase transaction outputs can only be spent after this number of new blocks (network rule).
isminetype
IsMine() return codes.
CTxDestination DecodeDestination(const std::string &addr, const CChainParams ¶ms)
QString HtmlEscape(const QString &str, bool fMultiLine)
QString dateTimeStr(const QDateTime &date)
std::vector< std::pair< std::string, std::string > > WalletOrderForm
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
bool ExtractDestination(const CScript &scriptPubKey, CTxDestination &addressRet)
Parse a standard scriptPubKey for the destination address.
bool IsValidDestination(const CTxDestination &dest)
Check whether a CTxDestination is a CNoDestination.
std::variant< CNoDestination, PKHash, ScriptHash > CTxDestination
A txout script template with a specific destination.
static constexpr Amount zero() noexcept
std::vector< isminetype > txout_is_mine
std::map< std::string, std::string > value_map
std::vector< isminetype > txin_is_mine
Updated transaction status.
bool GetPaymentRequestMerchant(const std::string &pr, QString &merchant)