extend generation descriptions

pull/2/merge
Wladimir J. van der Laan 14 years ago
parent 0eba00447e
commit e923f8188d

@ -17,7 +17,6 @@ public:
{ {
Immature, Immature,
Mature, Mature,
MaturesIn,
MaturesWarning, /* Will likely not mature because no nodes have confirmed */ MaturesWarning, /* Will likely not mature because no nodes have confirmed */
NotAccepted NotAccepted
}; };

@ -106,7 +106,6 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const CWalletTx
if (wtx.IsInMainChain()) if (wtx.IsInMainChain())
{ {
sub.status.maturity = TransactionStatus::MaturesIn;
sub.status.matures_in = wtx.GetBlocksToMaturity(); sub.status.matures_in = wtx.GetBlocksToMaturity();
// Check if the block was requested by anyone // Check if the block was requested by anyone

@ -184,9 +184,23 @@ QVariant TransactionTableModel::formatTxDescription(const TransactionRecord *wtx
description = tr("Payment to yourself"); description = tr("Payment to yourself");
break; break;
case TransactionRecord::Generated: case TransactionRecord::Generated:
/* TODO: more extensive description */ switch(wtx->status.maturity)
{
case TransactionStatus::Immature:
description = tr("Generated (matures in %n more blocks)", "",
wtx->status.matures_in);
break;
case TransactionStatus::Mature:
description = tr("Generated"); description = tr("Generated");
break; break;
case TransactionStatus::MaturesWarning:
description = tr("Generated - Warning: This block was not received by any other nodes and will probably not be accepted!");
break;
case TransactionStatus::NotAccepted:
description = tr("Generated (not accepted)");
break;
}
break;
} }
return QVariant(description); return QVariant(description);
} }

Loading…
Cancel
Save