Only perform certain behavior (namely that related to servicing
the getblocktemplate RPC call) for the active chainstate when
calling UpdateTip.
Co-authored-by: Jon Atack <jon@atack.com>
This is a backport of core#21526 [3/12]
https://github.com/bitcoin/bitcoin/pull/21526/commits/b217020df78bc981d221fe04497c831120ef969f
Depends on D12277
Notes:
- the main difference from the source material is that we do not have the code handling BIP9 deployments in `UpdateTip`. As a result, there is no need for the `warning_messages` arguments in `UpdateTipLog`
- for some reason, we did not have a `const` qualifier for the `CblockIndex *pindexNew` argument in `UpdateTip` in our codebase. I added it, because it is trivially correct.