qt: Better status text for mined transactions

Fixes ancient issue #614.
This commit is contained in:
Wladimir J. van der Laan 2014-01-06 16:30:19 +01:00
parent 65515c0d05
commit 04f58ffd9d

View File

@ -285,6 +285,24 @@ QString TransactionTableModel::formatTxStatus(const TransactionRecord *wtx) cons
{ {
QString status; QString status;
if(wtx->type == TransactionRecord::Generated)
{
switch(wtx->status.maturity)
{
case TransactionStatus::Immature:
status = tr("Immature (%1 confirmations, will be available after %2)").arg(wtx->status.depth).arg(wtx->status.depth + wtx->status.matures_in);
break;
case TransactionStatus::Mature:
status = tr("Confirmed (%1 confirmations)").arg(wtx->status.depth);
break;
case TransactionStatus::MaturesWarning:
status = tr("This block was not received by any other nodes and will probably not be accepted!");
break;
case TransactionStatus::NotAccepted:
status = tr("Generated but not accepted");
break;
}
} else {
switch(wtx->status.status) switch(wtx->status.status)
{ {
case TransactionStatus::OpenUntilBlock: case TransactionStatus::OpenUntilBlock:
@ -303,22 +321,6 @@ QString TransactionTableModel::formatTxStatus(const TransactionRecord *wtx) cons
status = tr("Confirmed (%1 confirmations)").arg(wtx->status.depth); status = tr("Confirmed (%1 confirmations)").arg(wtx->status.depth);
break; break;
} }
if(wtx->type == TransactionRecord::Generated)
{
switch(wtx->status.maturity)
{
case TransactionStatus::Immature:
status += "\n" + tr("Mined balance will be available when it matures in %n more block(s)", "", wtx->status.matures_in);
break;
case TransactionStatus::Mature:
break;
case TransactionStatus::MaturesWarning:
status += "\n" + tr("This block was not received by any other nodes and will probably not be accepted!");
break;
case TransactionStatus::NotAccepted:
status += "\n" + tr("Generated but not accepted");
break;
}
} }
return status; return status;