diff options
author | Gavin Andresen <gavinandresen@gmail.com> | 2013-01-14 12:06:07 -0800 |
---|---|---|
committer | Gavin Andresen <gavinandresen@gmail.com> | 2013-01-14 12:06:07 -0800 |
commit | e4f2b6b08f6328f62800616f93f842f902813c84 (patch) | |
tree | d99d5290ca5b29be4d257569bde868f3d7b4902c /src/qt | |
parent | 9980d118eebb584187b2e7a6cbcaeba2ffd56cfd (diff) | |
parent | 10046e27dbc10270f59385231736da2a9a327a8f (diff) |
Merge pull request #2159 from petertodd/display-nlocktime-correctly
Display tx nLockTime correctly when set to block #
Diffstat (limited to 'src/qt')
-rw-r--r-- | src/qt/transactiondesc.cpp | 2 | ||||
-rw-r--r-- | src/qt/transactionrecord.cpp | 2 | ||||
-rw-r--r-- | src/qt/transactionrecord.h | 4 | ||||
-rw-r--r-- | src/qt/transactiontablemodel.cpp | 2 |
4 files changed, 6 insertions, 4 deletions
diff --git a/src/qt/transactiondesc.cpp b/src/qt/transactiondesc.cpp index e358c12e96..d5b08448dd 100644 --- a/src/qt/transactiondesc.cpp +++ b/src/qt/transactiondesc.cpp @@ -14,7 +14,7 @@ QString TransactionDesc::FormatTxStatus(const CWalletTx& wtx) if (!wtx.IsFinal()) { if (wtx.nLockTime < LOCKTIME_THRESHOLD) - return tr("Open for %n block(s)", "", nBestHeight - wtx.nLockTime); + return tr("Open for %n more block(s)", "", wtx.nLockTime - nBestHeight + 1); else return tr("Open until %1").arg(GUIUtil::dateTimeStr(wtx.nLockTime)); } diff --git a/src/qt/transactionrecord.cpp b/src/qt/transactionrecord.cpp index 4c3071984f..40a5f735cd 100644 --- a/src/qt/transactionrecord.cpp +++ b/src/qt/transactionrecord.cpp @@ -167,7 +167,7 @@ void TransactionRecord::updateStatus(const CWalletTx &wtx) if (wtx.nLockTime < LOCKTIME_THRESHOLD) { status.status = TransactionStatus::OpenUntilBlock; - status.open_for = nBestHeight - wtx.nLockTime; + status.open_for = wtx.nLockTime - nBestHeight + 1; } else { diff --git a/src/qt/transactionrecord.h b/src/qt/transactionrecord.h index db06374c44..f6570803de 100644 --- a/src/qt/transactionrecord.h +++ b/src/qt/transactionrecord.h @@ -47,7 +47,9 @@ public: @{*/ 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) */ diff --git a/src/qt/transactiontablemodel.cpp b/src/qt/transactiontablemodel.cpp index 847c9e9733..aef0e409bd 100644 --- a/src/qt/transactiontablemodel.cpp +++ b/src/qt/transactiontablemodel.cpp @@ -280,7 +280,7 @@ QString TransactionTableModel::formatTxStatus(const TransactionRecord *wtx) cons switch(wtx->status.status) { case TransactionStatus::OpenUntilBlock: - status = tr("Open for %n block(s)","",wtx->status.open_for); + status = tr("Open for %n more block(s)","",wtx->status.open_for); break; case TransactionStatus::OpenUntilDate: status = tr("Open until %1").arg(GUIUtil::dateTimeStr(wtx->status.open_for)); |