[validation/refactor] store precomputed txdata in workspace
Summary:
We want to be able to re-use the precomputed transaction data between
PolicyScriptChecks and ConsensusScriptChecks in
AcceptMultipleTransactions.
For Bitcoin ABC, the PolicyScriptChecks code is part of PreChecks.
D8203 duplicated the initialization of the PrecomputedTransactionData. This patch changes it to be computed only once, and only if the cheap pre-checks are successful.
This is a partial backport of core#23381
https://github.com/bitcoin/bitcoin/pull/23381/commits/cbb3598b5ce2bea58a8cb1ad2167d7d1d079acf7
Test Plan: ninja all check-all
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Subscribers: Fabien
Differential Revision: https://reviews.bitcoinabc.org/D12347