Merge pull request #3491
04f58ff
qt: Better status text for mined transactions (Wladimir J. van der Laan)
This commit is contained in:
commit
13e99e463d
1 changed files with 23 additions and 21 deletions
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue