Permalink
Browse files

Display tx nLockTime correctly when set to block #

  • Loading branch information...
Tranz5 committed Aug 20, 2014
1 parent e312508 commit fa8aaad4d186785d2b323e85cf922aaeace00eb1
Showing with 5 additions and 3 deletions.
  1. +1 −1 src/qt/transactiondesc.cpp
  2. +1 −1 src/qt/transactionrecord.cpp
  3. +3 −1 src/qt/transactionrecord.h
@@ -15,7 +15,7 @@ QString TransactionDesc::FormatTxStatus(const CWalletTx& wtx)
if (!IsFinalTx(wtx, nBestHeight + 1))
{
if (wtx.nLockTime < LOCKTIME_THRESHOLD)
return tr("Open for %n more block(s)", "", wtx.nLockTime - nBestHeight);
return tr("Open for %n more block(s)", "", wtx.nLockTime - nBestHeight + 1);
else
return tr("Open until %1").arg(GUIUtil::dateTimeStr(wtx.nLockTime));
}
@@ -180,7 +180,7 @@ void TransactionRecord::updateStatus(const CWalletTx &wtx)
if (wtx.nLockTime < LOCKTIME_THRESHOLD)
{
status.status = TransactionStatus::OpenUntilBlock;
status.open_for = wtx.nLockTime - nBestHeight;
status.open_for = wtx.nLockTime - nBestHeight + 1;
}
else
{
@@ -48,7 +48,9 @@ class TransactionStatus
@{*/
Status status;
int64 depth;
int64 open_for; /**< Timestamp if status==OpenUntilDate, otherwise number of blocks */
int64 open_for; /**< Timestamp if status==OpenUntilDate, otherwise number
of additional blocks that need to be mined before
finalization */
/**@}*/
/** Current number of blocks (to know whether cached status is still valid) */

0 comments on commit fa8aaad

Please sign in to comment.