[backport#15931 7/9] Use CWallet::m_last_block_processed_height in GetDepthInMainChain
Summary:
Avoid to lock chain to query state thanks to tracking last block
height in CWallet.
https://github.com/bitcoin/bitcoin/pull/15931/commits/0ff03871add000f8b4d8f82aeb168eed2fc9dc5f
Depends on D7511
Partial backport of Core PR15931
Test Plan:
ninja check check-functional
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D7512