HomePhabricator

[core#19011 3/3] Reduce cs_main lock accumulation during GUI startup

Description

[core#19011 3/3] Reduce cs_main lock accumulation during GUI startup

Summary:
PR description:

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 concludes backport of core#19011 [4/4]
https://github.com/bitcoin/bitcoin/pull/19011/commits/386ec192a57b76492125d691ceda1b4aa832312e

Depends on D9735
Depends on D9737

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, majcosta

Reviewed By: #bitcoin_abc, majcosta

Subscribers: Fabien

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

Details

Provenance
Jonas Schnelli <dev@jonasschnelli.ch>Authored on May 19 2020, 13:15
PiRKCommitted on Jul 6 2021, 07:17
PiRKPushed on Jul 6 2021, 07:17
Reviewer
Restricted Project
Differential Revision
D9736: [core#19011 3/3] Reduce cs_main lock accumulation during GUI startup
Parents
rABC874450266794: [core#19104] gui, refactor: Register Qt meta types in application constructor
Branches
Unknown
Tags
Unknown