From 0f9d27dfef6f27f5c4d97a060c0954846d3ea547 Mon Sep 17 00:00:00 2001 From: levonpetrosyan93 <45027856+levonpetrosyan93@users.noreply.github.com> Date: Thu, 8 Feb 2024 21:39:01 +0400 Subject: [PATCH] Tx size estimation fixed on Send dialog (#1411) --- src/qt/sendcoinsdialog.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index baa5412e11..8880bf0af7 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -461,14 +461,17 @@ void SendCoinsDialog::on_sendButton_clicked() } QString questionString = tr("Are you sure you want to send?"); questionString.append("

%1"); + double txSize; if ((fAnonymousMode == false) && (recipients.size() == sparkAddressCount) && spark::IsSparkAllowed()) { for (auto &transaction : transactions) { txFee += transaction.getTransactionFee(); mintSparkAmount += transaction.getTotalTransactionAmount(); + txSize += (double)transaction.getTransactionSize(); } } else { - txFee= currentTransaction.getTransactionFee(); + txFee = currentTransaction.getTransactionFee(); + txSize = (double)currentTransaction.getTransactionSize(); } if(txFee > 0) @@ -480,7 +483,7 @@ void SendCoinsDialog::on_sendButton_clicked() questionString.append(tr("added as transaction fee")); // append transaction size - questionString.append(" (" + QString::number((double)currentTransaction.getTransactionSize() / 1000) + " kB)"); + questionString.append(" (" + QString::number(txSize / 1000) + " kB)"); } // add total amount in all subdivision units