Merge pull request #3491

04f58ff qt: Better status text for mined transactions (Wladimir J. van der Laan)
This commit is contained in:
Wladimir J. van der Laan 2014-01-09 10:08:11 +01:00
commit 13e99e463d
No known key found for this signature in database
GPG key ID: 74810B012346C9A6

View file

@ -285,6 +285,24 @@ QString TransactionTableModel::formatTxStatus(const TransactionRecord *wtx) cons
{
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)
{
case TransactionStatus::OpenUntilBlock:
@ -303,22 +321,6 @@ QString TransactionTableModel::formatTxStatus(const TransactionRecord *wtx) cons
status = tr("Confirmed (%1 confirmations)").arg(wtx->status.depth);
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;