[Bitcoin-ABC/bitcoin-abc] Use output-then-input block validation before fork (with tests) (#244)

This will use the output-then-input validation order before the planned Nov 15 hard fork as well as after. Before the fork, this code will verify the topological sorting by making a memo of where in the block each output came from when doing the output inserts, and checking those memos when spending outputs from elsewhere within the block.

I’m not certain that the try-catch block is the best way to deal with the pre-BIP30 scenario. It seems to work okay, but it gives me the heebie jeebies that I might have overlooked something.

Successfully syncs past the BIP30 fork at height 91880. My node hasn’t made it to the BCH fork yet, though.
You can view, comment on, or merge this pull request online at:

https://github.com/Bitcoin-ABC/bitcoin-abc/pull/244

— Commit Summary —

* Use output-then-input block validation before fork (with tests)

— File Changes —

M src/test/txvalidationcache_tests.cpp (51)
M src/validation.cpp (24)

— Patch Links —

https://github.com/Bitcoin-ABC/bitcoin-abc/pull/244.patch
https://github.com/Bitcoin-ABC/bitcoin-abc/pull/244.diff