better error message for mandatory-flag tx rejections
Summary:
Currently, if a transaction fails both a standardness rule and a consensus
rule, then the rejection message will look a bit weird, for example if
a script uses a NOPcode but also fails a VERIFY operation then:
"mandatory-script-verify-flag-failed (NOPx reserved for soft-fork upgrades)"
This change makes the error message reflect the actual violation, for
example:
"mandatory-script-verify-flag-failed (Script failed an OP_VERIFY operation)"
The main improvement is however in the upgrade-conditional error message,
as seen in the test.
The behaviour for non-mandatory failures is unchanged: the error message
will reflect the violation of a non-mandatory flag.
Test Plan:
make check
./test/functional/test_runner.py
./test/functional/test_runner.py --with-gravitonactivation
Reviewers: jasonbcox, Fabien, Mengerian, deadalnix, #bitcoin_abc
Reviewed By: deadalnix, #bitcoin_abc
Differential Revision: https://reviews.bitcoinabc.org/D3811