Rationale:
The height based polling in the GUI is an issue on chain reorgs. Any new tip signal with the same height as the one that it’s cached in the model was not triggering the GUI update (interpreting it as the same same block when it could receive a different one). Ending up with bad information presented in the GUI.
This PR essentially changes the last cached height to be a last cached block hash.
Old historical information of this PR.
As the tip height is cached and updated via signaling in clientModel, there is no need to continue locking cs_main
on every balance poll (m_node.getNumBlocks()
method call).
Extra topic:
Would suggest to change the cachedNumBlocks
field inside walletModel
to a more understandable name, maybe nLastBalanceUpdateHeight
.
And finally, this will have the equal height reorg issue mentioned here, whatever is presented to fix it, this should use the same flow too.
[Edit - 24/01/2020]
Have added #17905 comment fix here too.