14 #include <validation.h> 29 if (wtx.
tx->nLockTime < LOCKTIME_THRESHOLD)
38 return tr(
"conflicted with a transaction with %1 confirmations").arg(-nDepth);
40 return tr(
"%1/offline").arg(nDepth);
42 return tr(
"0/unconfirmed, %1").arg((wtx.
InMempool() ? tr(
"in memory pool") : tr(
"not in memory pool"))) + (wtx.
isAbandoned() ?
", "+tr(
"abandoned") :
"");
44 return tr(
"%1/unconfirmed").arg(nDepth);
46 return tr(
"%1 confirmations").arg(nDepth);
55 strHTML.reserve(4000);
56 strHTML +=
"<html><font face='verdana, arial, helvetica, sans-serif'>";
61 CAmount nNet = nCredit - nDebit;
68 strHTML += tr(
", has not been successfully broadcast yet");
69 else if (nRequests > 0)
70 strHTML += tr(
", broadcast through %n node(s)",
"", nRequests);
81 strHTML +=
"<b>" + tr(
"Source") +
":</b> " + tr(
"Generated") +
"<br>";
99 strHTML +=
"<b>" + tr(
"From") +
":</b> " + tr(
"unknown") +
"<br>";
100 strHTML +=
"<b>" + tr(
"To") +
":</b> ";
106 strHTML +=
" (" + addressOwned +
")";
119 std::string strAddress = wtx.
mapValue[
"to"];
120 strHTML +=
"<b>" + tr(
"To") +
":</b> ";
136 for (
const CTxOut& txout : wtx.
tx->vout)
138 strHTML +=
"<b>" + tr(
"Credit") +
":</b> ";
142 strHTML +=
"(" + tr(
"not accepted") +
")";
155 for (
const CTxIn& txin : wtx.
tx->vin)
158 if(fAllFromMe > mine) fAllFromMe =
mine;
162 for (
const CTxOut& txout : wtx.
tx->vout)
165 if(fAllToMe > mine) fAllToMe =
mine;
171 strHTML +=
"<b>" + tr(
"From") +
":</b> " + tr(
"watch-only") +
"<br>";
176 for (
const CTxOut& txout : wtx.
tx->vout)
189 strHTML +=
"<b>" + tr(
"To") +
":</b> ";
194 strHTML +=
" (own address)";
195 else if(toSelf & ISMINE_WATCH_ONLY)
196 strHTML +=
" (watch-only)";
210 CAmount nValue = nCredit - nChange;
215 CAmount nTxFee = nDebit - wtx.
tx->GetValueOut();
224 for (
const CTxIn& txin : wtx.
tx->vin)
227 for (
const CTxOut& txout : wtx.
tx->vout)
228 if (wallet->
IsMine(txout))
243 strHTML +=
"<b>" + tr(
"Transaction ID") +
":</b> " + rec->
getTxID() +
"<br>";
244 strHTML +=
"<b>" + tr(
"Transaction total size") +
":</b> " + QString::number(wtx.
tx->GetTotalSize()) +
" bytes<br>";
245 strHTML +=
"<b>" + tr(
"Output index") +
":</b> " + QString::number(rec->
getOutputIndex()) +
"<br>";
248 for (
const std::pair<std::string, std::string>& r : wtx.
vOrderForm)
249 if (r.first ==
"Message")
250 strHTML +=
"<br><b>" + tr(
"Message") +
":</b><br>" +
GUIUtil::HtmlEscape(r.second,
true) +
"<br>";
255 for (
const std::pair<std::string, std::string>& r : wtx.
vOrderForm)
257 if (r.first ==
"PaymentRequest")
260 req.
parse(QByteArray::fromRawData(r.second.data(), r.second.size()));
269 quint32 numBlocksToMaturity = COINBASE_MATURITY + 1;
270 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>";
278 strHTML +=
"<hr><br>" + tr(
"Debug information") +
"<br><br>";
279 for (
const CTxIn& txin : wtx.
tx->vin)
282 for (
const CTxOut& txout : wtx.
tx->vout)
286 strHTML +=
"<br><b>" + tr(
"Transaction") +
":</b><br>";
289 strHTML +=
"<br><b>" + tr(
"Inputs") +
":</b>";
292 for (
const CTxIn& txin : wtx.
tx->vin)
307 strHTML += QString::fromStdString(
CFabcoinAddress(address).ToString());
310 strHTML = strHTML +
" IsMine=" + (wallet->
IsMine(vout) &
ISMINE_SPENDABLE ? tr(
"true") : tr(
"false")) +
"</li>";
311 strHTML = strHTML +
" IsWatchOnly=" + (wallet->
IsMine(vout) &
ISMINE_WATCH_ONLY ? tr(
"true") : tr(
"false")) +
"</li>";
319 strHTML +=
"</font></html>";
boost::variant< CNoDestination, CKeyID, CScriptID > CTxDestination
A txout script template with a specific destination.
int GetDepthInMainChain(const CBlockIndex *&pindexRet) const
Return depth of transaction in blockchain: <0 : conflicts with a transaction this deep in the blockch...
CAmount GetCredit(const CTxOut &txout, const isminefilter &filter) const
QString getTxID() const
Return the unique identifier for this transaction (part)
std::map< CTxDestination, CAddressBookData > mapAddressBook
CCriticalSection cs_wallet
int getOutputIndex() const
Return the output index of the subtransaction.
bool getMerchant(X509_STORE *certStore, QString &merchant) const
base58-encoded Fabcoin addresses.
CTxOut out
unspent transaction output
QString dateTimeStr(const QDateTime &date)
isminetype IsMine(const CKeyStore &keystore, const CScript &scriptPubKey, SigVersion sigversion)
QString HtmlEscape(const QString &str, bool fMultiLine)
int64_t GetTxTime() const
std::atomic< uint32_t > logCategories
CAmount GetCredit(const isminefilter &filter) const
CAmount GetDebit(const isminefilter &filter) const
filter decides which addresses will count towards the debit
mapValue_t mapValue
Key/value map with information about the transaction.
int64_t CAmount
Amount in lius (Can be negative)
#define AssertLockHeld(cs)
int GetBlocksToMaturity() const
CCoinsViewCache * pcoinsTip
Global variable that points to the active CCoinsView (protected by cs_main)
int Height() const
Return the maximal height in the chain.
bool IsInMainChain() const
UI model for a transaction.
bool CheckFinalTx(const CTransaction &tx, int flags)
Check if transaction will be final in the next block to be created.
isminetype
IsMine() return codes.
An input of a transaction.
bool ExtractDestination(const CScript &scriptPubKey, CTxDestination &addressRet, txnouttype *typeRet)
CAmount GetDebit(const CTxIn &txin, const isminefilter &filter) const
Returns amount of debit if the input matches the filter, otherwise returns 0.
An output of a transaction.
CChain chainActive
The currently-connected chain of blocks (protected by cs_main).
static X509_STORE * getCertStore()
An outpoint - a combination of a transaction hash and an index n into its vout.
CTxDestination Get() const
bool parse(const QByteArray &data)
A transaction with a bunch of additional info that only the owner cares about.
bool GetCoin(const COutPoint &outpoint, Coin &coin) const override
Retrieve the Coin (unspent transaction output) for a given outpoint.
int GetRequestCount() const
int64_t GetAdjustedTime()
A CWallet is an extension of a keystore, which also maintains a set of transactions and balances...
static QString formatHtmlWithUnit(int unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=separatorStandard)
Format as HTML string (with unit)
isminetype IsMine(const CTxIn &txin) const
static QString FormatTxStatus(const CWalletTx &wtx)
struct evm_uint160be address(struct evm_env *env)
unsigned int nTimeReceived
time received by this node
static QString toHTML(CWallet *wallet, CWalletTx &wtx, TransactionRecord *rec, int unit)
void mine(Client &c, int numBlocks)
CAmount GetChange() const
std::vector< std::pair< std::string, std::string > > vOrderForm