aboutsummaryrefslogtreecommitdiff
path: root/src/qt
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2014-01-27 10:15:18 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2014-01-27 10:16:54 +0100
commitca1913e8f64fc245157b008d6b37160306aa1d83 (patch)
tree65d4289e4ab9aac220e22a0f20ac501f6dbf47fb /src/qt
parentb571a8c7086043df0b16a10fe7953495607d3d5a (diff)
parent665bdd3bc9ba4ac566edf5ba3fa8bbd93eb4780f (diff)
Merge pull request #2342
665bdd3 Fix off-by-one errors in use of IsFinalTx() (Peter Todd)
Diffstat (limited to 'src/qt')
-rw-r--r--src/qt/transactiondesc.cpp4
-rw-r--r--src/qt/transactionrecord.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/qt/transactiondesc.cpp b/src/qt/transactiondesc.cpp
index 2c3a9e3a5c..c76b29861d 100644
--- a/src/qt/transactiondesc.cpp
+++ b/src/qt/transactiondesc.cpp
@@ -20,10 +20,10 @@
QString TransactionDesc::FormatTxStatus(const CWalletTx& wtx)
{
- if (!IsFinalTx(wtx))
+ if (!IsFinalTx(wtx, chainActive.Height() + 1))
{
if (wtx.nLockTime < LOCKTIME_THRESHOLD)
- return tr("Open for %n more block(s)", "", wtx.nLockTime - chainActive.Height() + 1);
+ return tr("Open for %n more block(s)", "", wtx.nLockTime - chainActive.Height());
else
return tr("Open until %1").arg(GUIUtil::dateTimeStr(wtx.nLockTime));
}
diff --git a/src/qt/transactionrecord.cpp b/src/qt/transactionrecord.cpp
index 6823557ebc..257151b926 100644
--- a/src/qt/transactionrecord.cpp
+++ b/src/qt/transactionrecord.cpp
@@ -168,12 +168,12 @@ void TransactionRecord::updateStatus(const CWalletTx &wtx)
status.depth = wtx.GetDepthInMainChain();
status.cur_num_blocks = chainActive.Height();
- if (!IsFinalTx(wtx))
+ if (!IsFinalTx(wtx, chainActive.Height() + 1))
{
if (wtx.nLockTime < LOCKTIME_THRESHOLD)
{
status.status = TransactionStatus::OpenUntilBlock;
- status.open_for = wtx.nLockTime - chainActive.Height() + 1;
+ status.open_for = wtx.nLockTime - chainActive.Height();
}
else
{