From 1c14b9aa93445cc5d20a661b61ef9a388d4c61d4 Mon Sep 17 00:00:00 2001 From: ardocrat Date: Sun, 27 Oct 2024 19:02:17 +0300 Subject: [PATCH] tx: fix confirmation status for new block, do not show Slatepack message after finalization --- src/gui/views/wallets/wallet/txs/content.rs | 47 ++++++++++++++++----- src/gui/views/wallets/wallet/txs/tx.rs | 1 + 2 files changed, 38 insertions(+), 10 deletions(-) diff --git a/src/gui/views/wallets/wallet/txs/content.rs b/src/gui/views/wallets/wallet/txs/content.rs index 7ace999..2d81991 100644 --- a/src/gui/views/wallets/wallet/txs/content.rs +++ b/src/gui/views/wallets/wallet/txs/content.rs @@ -339,6 +339,30 @@ impl WalletTransactions { DOTS_THREE_CIRCLE, t!("wallets.tx_sending")) }, + TxLogEntryType::ConfirmedCoinbase => { + let tx_h = tx.height.unwrap_or(1) - 1; + if tx_h != 0 { + let left_conf = height - tx_h; + if height >= tx_h && left_conf < COINBASE_MATURITY { + let conf_info = format!("{}/{}", + left_conf, + COINBASE_MATURITY); + format!("{} {} {}", + DOTS_THREE_CIRCLE, + t!("wallets.tx_confirming"), + conf_info + ) + } else { + format!("{} {}", + DOTS_THREE_CIRCLE, + t!("wallets.tx_confirming")) + } + } else { + format!("{} {}", + DOTS_THREE_CIRCLE, + t!("wallets.tx_confirming")) + } + }, _ => { format!("{} {}", DOTS_THREE_CIRCLE, @@ -353,17 +377,20 @@ impl WalletTransactions { let tx_h = tx.height.unwrap_or(1) - 1; if tx_h != 0 { let left_conf = height - tx_h; - let conf_info = if tx_h != 0 && height >= tx_h && - left_conf < COINBASE_MATURITY { - format!("{}/{}", left_conf, COINBASE_MATURITY) + if height >= tx_h && left_conf < COINBASE_MATURITY { + let conf_info = format!("{}/{}", + left_conf, + COINBASE_MATURITY); + format!("{} {} {}", + DOTS_THREE_CIRCLE, + t!("wallets.tx_confirming"), + conf_info + ) } else { - "".to_string() - }; - format!("{} {} {}", - DOTS_THREE_CIRCLE, - t!("wallets.tx_confirming"), - conf_info - ) + format!("{} {}", + DOTS_THREE_CIRCLE, + t!("wallets.tx_confirmed")) + } } else { format!("{} {}", DOTS_THREE_CIRCLE, diff --git a/src/gui/views/wallets/wallet/txs/tx.rs b/src/gui/views/wallets/wallet/txs/tx.rs index a708c00..eb77bb4 100644 --- a/src/gui/views/wallets/wallet/txs/tx.rs +++ b/src/gui/views/wallets/wallet/txs/tx.rs @@ -203,6 +203,7 @@ impl WalletTransactionModal { if let Ok(_) = res { self.show_finalization = false; self.finalize_edit = "".to_string(); + self.response_edit = "".to_string(); } else { self.finalize_error = true; }