mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-13 07:28:59 +01:00
Don't label transactions "Open" while catching up
Since the default `nSequence` is `0xFFFFFFFE` and locktime is enabled, the checking `wtx.is_final` is meaningless until the syncing has completed.
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
|
||||
#include <qt/transactionrecord.h>
|
||||
|
||||
#include <chain.h>
|
||||
#include <consensus/consensus.h>
|
||||
#include <interfaces/wallet.h>
|
||||
#include <key_io.h>
|
||||
@@ -12,6 +13,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <QDateTime>
|
||||
|
||||
/* Return positive answer if transaction should be shown in list.
|
||||
*/
|
||||
@@ -158,7 +160,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
|
||||
|
||||
@@ -172,10 +174,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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user