Skip to content

gui: Long or blocking calls should be async #16874

@promag

Description

@promag

The comment here is not entirely correct:

// 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
// holding the locks for a longer time - for example, during a wallet
// rescan.

The problem happens when the locks are held and calculating the balance takes a lot of time - causing the GUI to stuck.

Beside the obvious improvement - drop polling and update only when necessary - the actual balance calculation must be asynchronous otherwise Qt's event loop isn't able to make the GUI smooth - noticeable on big wallet. This also applies for anything that takes a lot - whether it requires other locks or not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions