19 #include <validation.h>    34         if (wtx.
tx->nLockTime < LOCKTIME_THRESHOLD)
    35             return tr(
"Open for %n more block(s)", 
"", wtx.
tx->nLockTime - numBlocks);
    43             return tr(
"conflicted with a transaction with %1 confirmations").arg(-nDepth);
    45             return tr(
"0/unconfirmed, %1").arg((inMempool ? tr(
"in memory pool") : tr(
"not in memory pool"))) + (status.
is_abandoned ? 
", "+tr(
"abandoned") : 
"");
    47             return tr(
"%1/unconfirmed").arg(nDepth);
    49             return tr(
"%1 confirmations").arg(nDepth);
    64     strHTML.reserve(4000);
    65     strHTML += 
"<html><font face='verdana, arial, helvetica, sans-serif'>";
    67     int64_t nTime = wtx.
time;
    70     CAmount nNet = nCredit - nDebit;
    72     strHTML += 
"<b>" + tr(
"Status") + 
":</b> " + 
FormatTxStatus(wtx, status, inMempool, numBlocks, adjustedTime);
    82         strHTML += 
"<b>" + tr(
"Source") + 
":</b> " + tr(
"Generated") + 
"<br>";
   101                     strHTML += 
"<b>" + tr(
"From") + 
":</b> " + tr(
"unknown") + 
"<br>";
   102                     strHTML += 
"<b>" + tr(
"To") + 
":</b> ";
   104                     QString addressOwned = ismine == 
ISMINE_SPENDABLE ? tr(
"own address") : tr(
"watch-only");
   108                         strHTML += 
" (" + addressOwned + 
")";
   121         std::string strAddress = wtx.
value_map[
"to"];
   122         strHTML += 
"<b>" + tr(
"To") + 
":</b> ";
   126                 dest, &
name,  
nullptr,  
nullptr) && !
name.empty())
   140         for (
const CTxOut& txout : wtx.
tx->vout)
   142         strHTML += 
"<b>" + tr(
"Credit") + 
":</b> ";
   146             strHTML += 
"(" + tr(
"not accepted") + 
")";
   161             if(fAllFromMe > mine) fAllFromMe = mine;
   167             if(fAllToMe > mine) fAllToMe = mine;
   173                 strHTML += 
"<b>" + tr(
"From") + 
":</b> " + tr(
"watch-only") + 
"<br>";
   179             for (
const CTxOut& txout : wtx.
tx->vout)
   192                         strHTML += 
"<b>" + tr(
"To") + 
":</b> ";
   195                                 address, &
name,  
nullptr,  
nullptr) && !
name.empty())
   199                             strHTML += 
" (own address)";
   201                             strHTML += 
" (watch-only)";
   215                 CAmount nValue = nCredit - nChange;
   220             CAmount nTxFee = nDebit - wtx.
tx->GetValueOut();
   230             for (
const CTxIn& txin : wtx.
tx->vin) {
   236             for (
const CTxOut& txout : wtx.
tx->vout) {
   254     strHTML += 
"<b>" + tr(
"Transaction ID") + 
":</b> " + rec->
getTxHash() + 
"<br>";
   255     strHTML += 
"<b>" + tr(
"Transaction total size") + 
":</b> " + QString::number(wtx.
tx->GetTotalSize()) + 
" bytes<br>";
   257     strHTML += 
"<b>" + tr(
"Output index") + 
":</b> " + QString::number(rec->
getOutputIndex()) + 
"<br>";
   260     for (
const std::pair<std::string, std::string>& r : orderForm)
   261         if (r.first == 
"Message")
   262             strHTML += 
"<br><b>" + tr(
"Message") + 
":</b><br>" + 
GUIUtil::HtmlEscape(r.second, 
true) + 
"<br>";
   268     for (
const std::pair<std::string, std::string>& r : orderForm)
   270         if (r.first == 
"PaymentRequest")
   273             req.
parse(QByteArray::fromRawData(r.second.data(), r.second.size()));
   275             if (req.
getMerchant(PaymentServer::getCertStore(), merchant))
   283         quint32 numBlocksToMaturity = COINBASE_MATURITY +  1;
   284         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>";
   292         strHTML += 
"<hr><br>" + tr(
"Debug information") + 
"<br><br>";
   293         for (
const CTxIn& txin : wtx.
tx->vin)
   296         for (
const CTxOut& txout : wtx.
tx->vout)
   300         strHTML += 
"<br><b>" + tr(
"Transaction") + 
":</b><br>";
   303         strHTML += 
"<br><b>" + tr(
"Inputs") + 
":</b>";
   306         for (
const CTxIn& txin : wtx.
tx->vin)
   334     strHTML += 
"</font></html>";
 
int64_t GetVirtualTransactionSize(int64_t nWeight, int64_t nSigOpCost)
Compute the virtual transaction size (weight reinterpreted as bytes). 
 
virtual bool getAddress(const CTxDestination &dest, std::string *name, isminetype *is_mine, std::string *purpose)=0
Look up address in wallet, return whether exists. 
 
bool ExtractDestination(const CScript &scriptPubKey, CTxDestination &addressRet)
Parse a standard scriptPubKey for the destination address. 
 
virtual isminetype txoutIsMine(const CTxOut &txout)=0
Return whether transaction output belongs to wallet. 
 
QString getTxHash() const
Return the unique identifier for this transaction (part) 
 
std::vector< isminetype > txin_is_mine
 
std::vector< isminetype > txout_is_mine
 
static QString formatHtmlWithUnit(int unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=separatorStandard)
Format as HTML string (with unit) 
 
bool IsValidDestination(const CTxDestination &dest)
Check whether a CTxDestination is a CNoDestination. 
 
CTxOut out
unspent transaction output 
 
QString dateTimeStr(const QDateTime &date)
 
virtual uint32_t getLogCategories()=0
 
static QString toHTML(interfaces::Node &node, interfaces::Wallet &wallet, TransactionRecord *rec, int unit)
 
QString HtmlEscape(const QString &str, bool fMultiLine)
 
virtual isminetype txinIsMine(const CTxIn &txin)=0
Return whether transaction input belongs to wallet. 
 
int64_t CAmount
Amount in satoshis (Can be negative) 
 
int getOutputIndex() const
Return the output index of the subtransaction. 
 
UI model for a transaction. 
 
virtual CAmount getCredit(const CTxOut &txout, isminefilter filter)=0
Return credit amount if transaction input belongs to wallet. 
 
bool getMerchant(X509_STORE *certStore, QString &merchant) const
 
isminetype
IsMine() return codes. 
 
An input of a transaction. 
 
boost::variant< CNoDestination, CKeyID, CScriptID, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessUnknown > CTxDestination
A txout script template with a specific destination. 
 
static QString FormatTxStatus(const interfaces::WalletTx &wtx, const interfaces::WalletTxStatus &status, bool inMempool, int numBlocks, int64_t adjustedTime)
 
Interface for accessing a wallet. 
 
An output of a transaction. 
 
An outpoint - a combination of a transaction hash and an index n into its vout. 
 
bool parse(const QByteArray &data)
 
virtual CAmount getDebit(const CTxIn &txin, isminefilter filter)=0
Return debit amount if transaction input belongs to wallet. 
 
CTxDestination DecodeDestination(const std::string &str)
 
virtual WalletTx getWalletTxDetails(const uint256 &txid, WalletTxStatus &tx_status, WalletOrderForm &order_form, bool &in_mempool, int &num_blocks, int64_t &adjusted_time)=0
Get transaction details. 
 
std::vector< std::pair< std::string, std::string > > WalletOrderForm
 
std::string EncodeDestination(const CTxDestination &dest)
 
std::map< std::string, std::string > value_map
 
Top-level interface for a bitcoin node (bsha3d process). 
 
Updated transaction status. 
 
virtual bool getUnspentOutput(const COutPoint &output, Coin &coin)=0
Get unspent outputs associated with a transaction.