[Part 2 of 5] Add a CChainState class to clarify internal interfaces
Summary:
Move block writing out of AcceptBlock
Backport of Core PR 10279 commit e104f0f
https://github.com/bitcoin/bitcoin/pull/10279/commits/e104f0fb7e464f8cadb4cbc99e8329d22c35c36a
Depends on D1968
Progress towards T572
Test Plan:
make check
test_runner.py
Reviewers: #bitcoin_abc, schancel, Fabien
Reviewed By: #bitcoin_abc, Fabien
Subscribers: jasonbcox, teamcity
Differential Revision: https://reviews.bitcoinabc.org/D1969