From 10046e27dbc10270f59385231736da2a9a327a8f Mon Sep 17 00:00:00 2001 From: Peter Todd Date: Wed, 9 Jan 2013 03:14:48 -0500 Subject: 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. --- src/qt/transactionrecord.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/qt/transactionrecord.cpp') 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 { -- cgit v1.2.3