mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
fb3ce75807 Don't label transactions "Open" while catching up (Hennadii Stepanov)
Pull request description:
Fix #13299.
Since the default `nSequence` is `0xFFFFFFFE` and locktime is enabled, the checking `wtx.is_final` is meaningless until the syncing has completed (ref: #1026).
This PR makes the wallet mark a transaction "Unconfirmed" instead of misleading "Open for NNN more blocks" when syncing after a period of being offline.
Before this PR (with the issue):

With this PR (the issue has been resolved):

Tree-SHA512: 358ec83b43c266a4d32a37a79dda80e80d40a2b77ad38261c84a095e613399f674aa7184805b3f6310e51ddb83ae2636b8849fcc7c4333e1b3ecbb0f70ad86d3
This commit is contained in:
@@ -318,7 +318,8 @@ public:
|
||||
}
|
||||
bool tryGetTxStatus(const uint256& txid,
|
||||
interfaces::WalletTxStatus& tx_status,
|
||||
int& num_blocks) override
|
||||
int& num_blocks,
|
||||
int64_t& block_time) override
|
||||
{
|
||||
auto locked_chain = m_wallet.chain().lock(true /* try_lock */);
|
||||
if (!locked_chain) {
|
||||
@@ -333,6 +334,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
num_blocks = ::chainActive.Height();
|
||||
block_time = ::chainActive.Tip()->GetBlockTime();
|
||||
tx_status = MakeWalletTxStatus(*locked_chain, mi->second);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -178,7 +178,8 @@ public:
|
||||
//! Try to get updated status for a particular transaction, if possible without blocking.
|
||||
virtual bool tryGetTxStatus(const uint256& txid,
|
||||
WalletTxStatus& tx_status,
|
||||
int& num_blocks) = 0;
|
||||
int& num_blocks,
|
||||
int64_t& block_time) = 0;
|
||||
|
||||
//! Get transaction details.
|
||||
virtual WalletTx getWalletTxDetails(const uint256& txid,
|
||||
|
||||
Reference in New Issue
Block a user