aboutsummaryrefslogtreecommitdiff
path: root/src/wallet
diff options
context:
space:
mode:
authorRussell Yanofsky <[email protected]>2020-01-16 15:56:58 -0500
committerRussell Yanofsky <[email protected]>2020-03-31 08:36:02 -0500
commitf6da44ccce4cfff53433e665305a6fe0a01364e4 (patch)
treed0a3f3fd875398a2ff5b44d2bf5a2b24911e65e0 /src/wallet
parentrefactor: Add interfaces::FoundBlock class to selectively return block data (diff)
downloaddiscoin-f6da44ccce4cfff53433e665305a6fe0a01364e4.tar.xz
discoin-f6da44ccce4cfff53433e665305a6fe0a01364e4.zip
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.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h
index fe5977348..26824946c 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)
{