Merge #8672: Qt: Show transaction size in transaction details window
c015634
qt: Adding transaction size to transaction details window (Hampus Sjöberg) \-- merge fix for s/size/total size/fdf82fb
Adding method GetTotalSize() to CTransaction (Hampus Sjöberg)
This commit is contained in:
commit
6052d50910
3 changed files with 13 additions and 0 deletions
|
@ -131,6 +131,11 @@ unsigned int CTransaction::CalculateModifiedSize(unsigned int nTxSize) const
|
||||||
return nTxSize;
|
return nTxSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned int CTransaction::GetTotalSize() const
|
||||||
|
{
|
||||||
|
return ::GetSerializeSize(*this, SER_NETWORK, PROTOCOL_VERSION);
|
||||||
|
}
|
||||||
|
|
||||||
std::string CTransaction::ToString() const
|
std::string CTransaction::ToString() const
|
||||||
{
|
{
|
||||||
std::string str;
|
std::string str;
|
||||||
|
|
|
@ -416,6 +416,13 @@ public:
|
||||||
// Compute modified tx size for priority calculation (optionally given tx size)
|
// Compute modified tx size for priority calculation (optionally given tx size)
|
||||||
unsigned int CalculateModifiedSize(unsigned int nTxSize=0) const;
|
unsigned int CalculateModifiedSize(unsigned int nTxSize=0) const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the total transaction size in bytes, including witness data.
|
||||||
|
* "Total Size" defined in BIP141 and BIP144.
|
||||||
|
* @return Total transaction size in bytes
|
||||||
|
*/
|
||||||
|
unsigned int GetTotalSize() const;
|
||||||
|
|
||||||
bool IsCoinBase() const
|
bool IsCoinBase() const
|
||||||
{
|
{
|
||||||
return (vin.size() == 1 && vin[0].prevout.IsNull());
|
return (vin.size() == 1 && vin[0].prevout.IsNull());
|
||||||
|
|
|
@ -241,6 +241,7 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, TransactionReco
|
||||||
strHTML += "<br><b>" + tr("Comment") + ":</b><br>" + GUIUtil::HtmlEscape(wtx.mapValue["comment"], true) + "<br>";
|
strHTML += "<br><b>" + tr("Comment") + ":</b><br>" + GUIUtil::HtmlEscape(wtx.mapValue["comment"], true) + "<br>";
|
||||||
|
|
||||||
strHTML += "<b>" + tr("Transaction ID") + ":</b> " + rec->getTxID() + "<br>";
|
strHTML += "<b>" + tr("Transaction ID") + ":</b> " + rec->getTxID() + "<br>";
|
||||||
|
strHTML += "<b>" + tr("Transaction total size") + ":</b> " + QString::number(wtx.GetTotalSize()) + " bytes<br>";
|
||||||
strHTML += "<b>" + tr("Output index") + ":</b> " + QString::number(rec->getOutputIndex()) + "<br>";
|
strHTML += "<b>" + tr("Output index") + ":</b> " + QString::number(rec->getOutputIndex()) + "<br>";
|
||||||
|
|
||||||
// Message from normal bitcoin:URI (bitcoin:123...?message=example)
|
// Message from normal bitcoin:URI (bitcoin:123...?message=example)
|
||||||
|
|
Loading…
Reference in a new issue