18#include <validation.h>
23#include <QLatin1String>
33 return tr(
"conflicted with a transaction with %1 confirmations").arg(-depth);
34 }
else if (depth == 0) {
40 s =
tr(
"0/unconfirmed, in memory pool");
45 s =
tr(
"0/unconfirmed, not in memory pool");
54 }
else if (depth < 6) {
59 return tr(
"%1/unconfirmed").arg(depth);
64 return tr(
"%1 confirmations").arg(depth);
73 std::vector<std::string> messages;
80 strHTML +=
"<html><font face='verdana, arial, helvetica, sans-serif'>";
97 strHTML +=
"<b>" +
tr(
"Source") +
":</b> " +
tr(
"Generated") +
"<br>";
98 }
else if (wtx.
from) {
111 if (
wallet.getAddress(address, &
name,
nullptr))
113 strHTML +=
"<b>" +
tr(
"From") +
":</b> " +
tr(
"unknown") +
"<br>";
137 dest, &
name,
nullptr) && !
name.empty())
151 for (
const CTxOut& txout : wtx.
tx->vout)
153 strHTML +=
"<b>" +
tr(
"Credit") +
":</b> ";
157 strHTML +=
"(" +
tr(
"not accepted") +
")";
177 for (
const CTxOut& txout : wtx.
tx->vout)
192 address, &
name,
nullptr) && !
name.empty())
196 strHTML +=
" (" +
tr(
"own address") +
")";
231 for (
const CTxOut& txout : wtx.
tx->vout) {
252 strHTML +=
"<b>" +
tr(
"Transaction total size") +
":</b> " + QString::number(wtx.
tx->ComputeTotalSize()) +
" bytes<br>";
257 for (
const std::string& msg : messages) {
264 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>";
272 strHTML +=
"<hr><br>" +
tr(
"Debug information") +
"<br><br>";
276 for (
const CTxOut& txout : wtx.
tx->vout)
277 if(
wallet.txoutIsMine(txout))
280 strHTML +=
"<br><b>" +
tr(
"Transaction") +
":</b><br>";
283 strHTML +=
"<br><b>" +
tr(
"Inputs") +
":</b>";
290 if (
auto prev{
node.getUnspentOutput(prevout)}) {
bool ExtractDestination(const CScript &scriptPubKey, CTxDestination &addressRet)
Parse a scriptPubKey for the destination.
bool IsValidDestination(const CTxDestination &dest)
Check whether a CTxDestination corresponds to one with an address.
std::variant< CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown > CTxDestination
A txout script categorized into standard templates.
int64_t CAmount
Amount in satoshis (Can be negative)
static QString formatHtmlWithUnit(Unit unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=SeparatorStyle::STANDARD)
Format as HTML string (with unit)
An outpoint - a combination of a transaction hash and an index n into its vout.
An input of a transaction.
An output of a transaction.
static QString FormatTxStatus(const interfaces::WalletTxStatus &status, bool inMempool)
static QString toHTML(interfaces::Node &node, interfaces::Wallet &wallet, TransactionRecord *rec, BitcoinUnit unit)
UI model for a transaction.
int getOutputIndex() const
Return the output index of the subtransaction
QString getTxHash() const
Return the unique identifier for this transaction (part)
Top-level interface for a bitcoin node (bitcoind process).
Interface for accessing a wallet.
constexpr int COINBASE_MATURITY
Coinbase transaction outputs can only be spent after this number of new blocks (network rule)
CTxDestination DecodeDestination(const std::string &str, std::string &error_msg, std::vector< int > *error_locations)
std::string EncodeDestination(const CTxDestination &dest)
QString HtmlEscape(const QString &str, bool fMultiLine)
QString dateTimeStr(const QDateTime &date)
int64_t GetVirtualTransactionSize(int64_t nWeight, int64_t nSigOpCost, unsigned int bytes_per_sigop)
Compute the virtual transaction size (weight reinterpreted as bytes).
std::vector< bool > txin_is_mine
std::optional< std::string > comment
std::optional< std::string > comment_to
std::vector< bool > txout_is_mine
std::optional< std::string > message
std::optional< std::string > from
Updated transaction status.
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.