MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / FormatTxStatus

Method FormatTxStatus

src/qt/transactiondesc.cpp:26–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24#include <string>
25
26QString TransactionDesc::FormatTxStatus(const interfaces::WalletTx& wtx, const interfaces::WalletTxStatus& status, bool inMempool, int numBlocks, int64_t adjustedTime)
27{
28 if (!status.is_final)
29 {
30 if (wtx.tx->nLockTime < LOCKTIME_THRESHOLD)
31 return tr("Open for %n more block(s)", "", wtx.tx->nLockTime - numBlocks);
32 else
33 return tr("Open until %1").arg(GUIUtil::dateTimeStr(wtx.tx->nLockTime));
34 }
35 else
36 {
37 int nDepth = status.depth_in_main_chain;
38 if (nDepth < 0)
39 return tr("conflicted with a transaction with %1 confirmations").arg(-nDepth);
40 else if (nDepth == 0)
41 return tr("0/unconfirmed, %1").arg((inMempool ? tr("in memory pool") : tr("not in memory pool"))) + (status.is_abandoned ? ", "+tr("abandoned") : "");
42 else if (nDepth < 6)
43 return tr("%1/unconfirmed").arg(nDepth);
44 else
45 return tr("%1 confirmations").arg(nDepth);
46 }
47}
48
49QString TransactionDesc::toHTML(interfaces::Node& node, interfaces::Wallet& wallet, TransactionRecord *rec, int unit)
50{

Callers

nothing calls this directly

Calls 1

dateTimeStrFunction · 0.85

Tested by

no test coverage detected