Cache script execution on a per transaction basis
Summary:
This ensure that we do not run the same script twice with the same set of flags. because we check script when accepting a transaction in the mempool, this shoudl ensure that we do not run the script when connecting a new block.
This is based on core's PR10192 , but the structure is somewhat different (the cache is moved in its own file for instance).
Test Plan:
make check ../qa/pull-tester/rpc-tests.py -extended
Run a node on testnet for a day, it looks like it all works well.
Reviewers: freetrader, CCulianu, #bitcoin_abc, dagurval
Reviewed By: #bitcoin_abc, dagurval
Subscribers: dagurval, sickpig
Differential Revision: https://reviews.bitcoinabc.org/D530