diff --git a/src/qt/transactionrecord.cpp b/src/qt/transactionrecord.cpp index 8a2ec4cd593c5d..08ea59de7a0b15 100644 --- a/src/qt/transactionrecord.cpp +++ b/src/qt/transactionrecord.cpp @@ -175,42 +175,31 @@ void TransactionRecord::updateStatus(const interfaces::WalletTxStatus& wtx, cons // For generated transactions, determine maturity if (type == TransactionRecord::Generated) { - if (wtx.blocks_to_maturity > 0) - { + if (wtx.blocks_to_maturity > 0) { status.status = TransactionStatus::Immature; - if (wtx.is_in_main_chain) - { + if (wtx.is_in_main_chain) { status.matures_in = wtx.blocks_to_maturity; - } - else - { + } else { status.status = TransactionStatus::NotAccepted; } - } - else - { + } else { status.status = TransactionStatus::Confirmed; } - } - else - { - if (status.depth < 0) - { + } else { + if (status.depth < 0) { status.status = TransactionStatus::Conflicted; } - else if (status.depth == 0) - { + else if (status.depth == 0) { status.status = TransactionStatus::Unconfirmed; - if (wtx.is_abandoned) + if (wtx.is_abandoned) { status.status = TransactionStatus::Abandoned; - } - else if (status.depth < RecommendedNumConfirmations) - { + } + } else if (wtx.is_assumed) { + status.status = TransactionStatus::AssumedConfirmed; + } else if (status.depth < RecommendedNumConfirmations) { status.status = TransactionStatus::Confirming; - } - else - { + } else { status.status = TransactionStatus::Confirmed; } } diff --git a/src/qt/transactionrecord.h b/src/qt/transactionrecord.h index 21b1bc0e018c14..9acbc93ab07578 100644 --- a/src/qt/transactionrecord.h +++ b/src/qt/transactionrecord.h @@ -25,6 +25,7 @@ struct TransactionStatus { Confirmed, /**< Have 6 or more confirmations (normal tx) or fully mature (mined tx) **/ /// Normal (sent/received) transactions Unconfirmed, /**< Not yet mined into a block **/ + AssumedConfirmed, /**< Confirmed, but background validation hasn't finished */ Confirming, /**< Confirmed, but waiting for the recommended number of confirmations **/ Conflicted, /**< Conflicts with other transaction or mempool **/ Abandoned, /**< Abandoned from the wallet **/ diff --git a/src/qt/transactiontablemodel.cpp b/src/qt/transactiontablemodel.cpp index 486e51c7776f5c..d67ac7315643c1 100644 --- a/src/qt/transactiontablemodel.cpp +++ b/src/qt/transactiontablemodel.cpp @@ -320,6 +320,9 @@ QString TransactionTableModel::formatTxStatus(const TransactionRecord *wtx) cons case TransactionStatus::Abandoned: status = tr("Abandoned"); break; + case TransactionStatus::AssumedConfirmed: + status = tr("%1 confirmations, pending verification of historical blocks").arg(wtx->status.depth); + break; case TransactionStatus::Confirming: status = tr("Confirming (%1 of %2 recommended confirmations)").arg(wtx->status.depth).arg(TransactionRecord::RecommendedNumConfirmations); break; @@ -465,6 +468,8 @@ QVariant TransactionTableModel::txStatusDecoration(const TransactionRecord *wtx) return QIcon(":/icons/transaction_0"); case TransactionStatus::Abandoned: return QIcon(":/icons/transaction_abandoned"); + case TransactionStatus::AssumedConfirmed: + return QIcon(":/icons/transaction_1"); case TransactionStatus::Confirming: switch(wtx->status.depth) { @@ -639,7 +644,14 @@ QVariant TransactionTableModel::data(const QModelIndex &index, int role) const return details; } case ConfirmedRole: - return rec->status.status == TransactionStatus::Status::Confirming || rec->status.status == TransactionStatus::Status::Confirmed; + switch (rec->status.status) { + case TransactionStatus::Status::AssumedConfirmed: + case TransactionStatus::Status::Confirming: + case TransactionStatus::Status::Confirmed: + return true; + default: + return false; + } case FormattedAmountRole: // Used for copy/export, so don't include separators return formatTxAmount(rec, false, BitcoinUnits::SeparatorStyle::NEVER);