Partial: Fix off-by-one errors in use of IsFinalTx()
Conflicts: src/main.cpp src/miner.cpp src/qt/transactiondesc.cpp src/qt/transactionrecord.cpp Rebased-from: 3f25f26edcc41b22130c5845024b86a9b1aa6183 0.8.x
This commit is contained in:
parent
d2ee3aecbe
commit
3a67c1ff27
@ -16,10 +16,10 @@
|
||||
|
||||
QString TransactionDesc::FormatTxStatus(const CWalletTx& wtx)
|
||||
{
|
||||
if (!wtx.IsFinal())
|
||||
if (!wtx.IsFinal(nBestHeight + 1))
|
||||
{
|
||||
if (wtx.nLockTime < LOCKTIME_THRESHOLD)
|
||||
return tr("Open for %n more block(s)", "", wtx.nLockTime - nBestHeight + 1);
|
||||
return tr("Open for %n more block(s)", "", wtx.nLockTime - nBestHeight);
|
||||
else
|
||||
return tr("Open until %1").arg(GUIUtil::dateTimeStr(wtx.nLockTime));
|
||||
}
|
||||
|
||||
@ -166,12 +166,12 @@ void TransactionRecord::updateStatus(const CWalletTx &wtx)
|
||||
status.depth = wtx.GetDepthInMainChain();
|
||||
status.cur_num_blocks = nBestHeight;
|
||||
|
||||
if (!wtx.IsFinal())
|
||||
if (!wtx.IsFinal(nBestHeight + 1))
|
||||
{
|
||||
if (wtx.nLockTime < LOCKTIME_THRESHOLD)
|
||||
{
|
||||
status.status = TransactionStatus::OpenUntilBlock;
|
||||
status.open_for = wtx.nLockTime - nBestHeight + 1;
|
||||
status.open_for = wtx.nLockTime - nBestHeight;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user