diff options
Diffstat (limited to 'src/qt/transactionrecord.cpp')
-rw-r--r-- | src/qt/transactionrecord.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/qt/transactionrecord.cpp b/src/qt/transactionrecord.cpp index 00455630e4..08ba030d65 100644 --- a/src/qt/transactionrecord.cpp +++ b/src/qt/transactionrecord.cpp @@ -4,14 +4,14 @@ #include <qt/transactionrecord.h> -#include <consensus/consensus.h> +#include <chain.h> #include <interfaces/wallet.h> #include <key_io.h> -#include <timedata.h> -#include <validation.h> +#include <wallet/ismine.h> #include <stdint.h> +#include <QDateTime> /* Return positive answer if transaction should be shown in list. */ @@ -162,7 +162,7 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const interface return parts; } -void TransactionRecord::updateStatus(const interfaces::WalletTxStatus& wtx, int numBlocks) +void TransactionRecord::updateStatus(const interfaces::WalletTxStatus& wtx, int numBlocks, int64_t block_time) { // Determine transaction status @@ -176,10 +176,9 @@ void TransactionRecord::updateStatus(const interfaces::WalletTxStatus& wtx, int status.depth = wtx.depth_in_main_chain; status.cur_num_blocks = numBlocks; - if (!wtx.is_final) - { - if (wtx.lock_time < LOCKTIME_THRESHOLD) - { + const bool up_to_date = ((int64_t)QDateTime::currentMSecsSinceEpoch() / 1000 - block_time < MAX_BLOCK_TIME_GAP); + if (up_to_date && !wtx.is_final) { + if (wtx.lock_time < LOCKTIME_THRESHOLD) { status.status = TransactionStatus::OpenUntilBlock; status.open_for = wtx.lock_time - numBlocks; } |