diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2019-01-15 17:25:14 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2019-01-15 17:39:19 +0100 |
commit | e8ad580f51532f6bfa6cb55688bffcc12196c0ac (patch) | |
tree | caeaa785212bc70ad92d5d827927d4ce85dfc31e /src/interfaces | |
parent | a5daf70ffb80c14ddf9f35c638d9e8087d8732e9 (diff) | |
parent | fb3ce75807c50055a97f573fc72bf44d997ea218 (diff) |
Merge #14556: qt: fix confirmed transaction labeled "open" (#13299)
fb3ce75807c50055a97f573fc72bf44d997ea218 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):
![screenshot from 2018-12-12 15-56-23](https://user-images.githubusercontent.com/32963518/49874288-cdd06880-fe26-11e8-8441-f3ceb479611b.png)
With this PR (the issue has been resolved):
![screenshot from 2018-12-12 15-54-41](https://user-images.githubusercontent.com/32963518/49874336-e9d40a00-fe26-11e8-8c05-9aeee2eb1bba.png)
Tree-SHA512: 358ec83b43c266a4d32a37a79dda80e80d40a2b77ad38261c84a095e613399f674aa7184805b3f6310e51ddb83ae2636b8849fcc7c4333e1b3ecbb0f70ad86d3
Diffstat (limited to 'src/interfaces')
-rw-r--r-- | src/interfaces/wallet.cpp | 4 | ||||
-rw-r--r-- | src/interfaces/wallet.h | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/interfaces/wallet.cpp b/src/interfaces/wallet.cpp index 672a557d41..8db34ed759 100644 --- a/src/interfaces/wallet.cpp +++ b/src/interfaces/wallet.cpp @@ -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; } diff --git a/src/interfaces/wallet.h b/src/interfaces/wallet.h index c79b9afce3..da60684a4f 100644 --- a/src/interfaces/wallet.h +++ b/src/interfaces/wallet.h @@ -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, |