This is needed for the next commit.
Note that `m_chainman` was made `const` by us in D12227 when backporting "validation: add chainman ref to CChainState" ([[https://github.com/bitcoin/bitcoin/pull/21526 | core#21526]]), because we could. In this commit is need to be made non-const so `m_chainman.AcceptBlockHeader` can be called. This member function cannot be made const.
This is a backport of [[https://github.com/bitcoin/bitcoin/pull/23785 | core#23785]]
https://github.com/bitcoin/bitcoin/pull/23785/commits/fa47b5c100f81c65c15b5a6afaf6c91bc0861264