diff options
author | Russell Yanofsky <russ@yanofsky.org> | 2020-01-16 15:56:58 -0500 |
---|---|---|
committer | Russell Yanofsky <russ@yanofsky.org> | 2020-03-31 08:36:02 -0500 |
commit | f6da44ccce4cfff53433e665305a6fe0a01364e4 (patch) | |
tree | d0a3f3fd875398a2ff5b44d2bf5a2b24911e65e0 /src/wallet | |
parent | bf30cd4922ea62577d7bf63f5029e8be62665d45 (diff) |
wallet: Avoid use of Chain::Lock in tryGetTxStatus and tryGetBalances
This is a step toward removing the Chain::Lock class and reducing cs_main
locking.
It also helps ensure the GUI display stays up to date in the case where the
node chain height runs ahead of wallet last block processed height.
Diffstat (limited to 'src/wallet')
-rw-r--r-- | src/wallet/wallet.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index fe59773488..26824946c6 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -1200,6 +1200,12 @@ public: assert(m_last_block_processed_height >= 0); return m_last_block_processed_height; }; + uint256 GetLastBlockHash() const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) + { + AssertLockHeld(cs_wallet); + assert(m_last_block_processed_height >= 0); + return m_last_block_processed; + } /** Set last block processed height, currently only use in unit test */ void SetLastBlockProcessed(int block_height, uint256 block_hash) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) { |