tx: fix confirmation status for new block, do not show Slatepack message after finalization

This commit is contained in:
ardocrat 2024-10-27 19:02:17 +03:00
parent 8ea388554a
commit 1c14b9aa93
2 changed files with 38 additions and 10 deletions

View file

@ -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,12 +377,10 @@ 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)
} else {
"".to_string()
};
if height >= tx_h && left_conf < COINBASE_MATURITY {
let conf_info = format!("{}/{}",
left_conf,
COINBASE_MATURITY);
format!("{} {} {}",
DOTS_THREE_CIRCLE,
t!("wallets.tx_confirming"),
@ -369,6 +391,11 @@ impl WalletTransactions {
DOTS_THREE_CIRCLE,
t!("wallets.tx_confirmed"))
}
} else {
format!("{} {}",
DOTS_THREE_CIRCLE,
t!("wallets.tx_confirmed"))
}
},
TxLogEntryType::TxSent | TxLogEntryType::TxReceived => {

View file

@ -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;
}