This is a backport of core#19521 [6 & 7/17]
https://github.com/bitcoin/bitcoin/pull/19521/commits/3f166ecc125fce6ccd995687fa16572090a5d099
https://github.com/bitcoin/bitcoin/pull/19521/commits/6a4c0c09ab4d073a26c3c4a02783d5dcd88f6eef (removal of 'disk_size' and 'transactions' from the index and test the RPC on specific heights)
Notes:
- in the source commits there is a call to ::ChainstateActive().ForceFlushStateToDisk(); added, but it is removed in a following commit in the same PR. This is obviously duplicated with the active_chainstate.ForceFlushStateToDisk() a few lines later, so I omitted it.
- I added a mention about disk_size not being available when using the index in the doc of the RPC call. This is added later in the same PR in an unrelated commit in the source material.
- the new hash_or_height RPC parameter needs to be added to the CRPCConvertParamtable for the unit tests to pass. This is done in a later commit in the same PR in the source material
Depends on D11599