HomePhabricator

[core#19011 1/3] RPCConsole, take initial chaintip data as parameter

Description

[core#19011 1/3] RPCConsole, take initial chaintip data as parameter

Summary:
PR description: Reduce cs_main lock accumulation during GUI startup

During the GUI startup, there is currently an accumulation of cs_main locks due to setting initial chain state values at multiple locations (in the GUI main thread).

This PR tries to cache the initial chain state (tip height, tip time, best header, etc.) short after loading the blockindex.

The cached values are then used instead of fetching them again (and thus locking cs_main) during setting the client model.

This should fix the initial GUI blocking often experienced during or short after the splashscreen.

This is a backport of core#19011 [1/4]
https://github.com/bitcoin/bitcoin/pull/19011/commits/25e1d0bf417237caa5d36b4e757f29e6c8be8aad

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D9734

Details

Provenance
Jonas Schnelli <dev@jonasschnelli.ch>Authored on May 19 2020, 13:11
PiRKCommitted on Jul 6 2021, 07:13
PiRKPushed on Jul 6 2021, 07:13
Reviewer
Restricted Project
Differential Revision
D9734: [core#19011 1/3] RPCConsole, take initial chaintip data as parameter
Parents
rABC0808fcb2af2c: reduce size of bg file for better load times
Branches
Unknown
Tags
Unknown