At the moment, the UI gets often not updated during initial sync or a catch-up of serval blocks. The UI’s try_lock often can’t acquire the lock which result in a bad user experience (“Baby, it’s not updating!”).
This PR changes the blocktip-update signal parameter form a bare hash (uint256
) to a CBlockIndex*
, which allows to safely get it’s height and timestamp without locking anything. In addition, the blocktip-update signal now gets fired also during initial sync, but with an extra boolean flag that indicates the initial sync state.
The PR temporarily has a benchmark for the tip update signal. On my standard system it uses 0.03ms for the signal (=reasonable). Keep in mind that this signal is synchronous, but it will emit another asynchronous QT signal to the UI thread that will care about the UI update!
The timer based update (every 250ms) is still active for bandwidth and mempool UI observation, although there no cs_main lock is required.