mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-17 13:07:54 +02:00
qt: Fix regression in TransactionTableModel
Since #17993 a crash is possible on exit. Co-authored-by: Russell Yanofsky <russ@yanofsky.org>
This commit is contained in:
parent
dbd7a91fdf
commit
d906aaa117
4 changed files with 12 additions and 3 deletions
|
|
@ -87,7 +87,7 @@ void WalletModel::pollBalanceChanged()
|
|||
{
|
||||
// Avoid recomputing wallet balances unless a TransactionChanged or
|
||||
// BlockTip notification was received.
|
||||
if (!fForceCheckBalanceChanged && m_cached_last_update_tip == m_client_model->getBestBlockHash()) return;
|
||||
if (!fForceCheckBalanceChanged && m_cached_last_update_tip == getLastBlockProcessed()) return;
|
||||
|
||||
// Try to get balances and return early if locks can't be acquired. This
|
||||
// avoids the GUI from getting stuck on periodical polls if the core is
|
||||
|
|
@ -588,3 +588,8 @@ void WalletModel::refresh(bool pk_hash_only)
|
|||
{
|
||||
addressTableModel = new AddressTableModel(this, pk_hash_only);
|
||||
}
|
||||
|
||||
uint256 WalletModel::getLastBlockProcessed() const
|
||||
{
|
||||
return m_client_model ? m_client_model->getBestBlockHash() : uint256{};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue