It is always applied in the same way, no matter how the txindex is
setup. This was no longer accurate after 8181db8, where their
initialization was made independent.
This is a partial backport of core#31483
https://github.com/bitcoin/bitcoin/pull/31483/commits/5db7d4d3d28bd1269a09955b4695135c86c4827d
Depends on D18577