aboutsummaryrefslogtreecommitdiff
path: root/src/qt/transactiondesc.cpp
diff options
context:
space:
mode:
authorPeter Todd <pete@petertodd.org>2013-01-09 03:14:48 -0500
committerPeter Todd <pete@petertodd.org>2013-01-09 04:18:26 -0500
commit10046e27dbc10270f59385231736da2a9a327a8f (patch)
treea489d08a60724a0387570aa556574d02b1dbd42b /src/qt/transactiondesc.cpp
parent429915bd0dfcdb03b13d9a3c2fb82d5401ef70ce (diff)
Display tx nLockTime correctly when set to block #
Previously when a transaction was set to lock at a specific block the calculation was reversed, returning a negative number. This broke the UI and caused it to display %n in place of the actual number. In addition the previous calculation would display "Open for 0 blocks" when the block height was such that the next block created would finalize the transaction. Inserted the word "more" and changed the calculation so that the last message would be "Open for 1 more block" to better match user expectations.
Diffstat (limited to 'src/qt/transactiondesc.cpp')
-rw-r--r--src/qt/transactiondesc.cpp2
1 files changed, 1 insertions, 1 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));
}