HomePhabricator

better error message for mandatory-flag tx rejections

Description

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

Event Timeline

Mark Lundeberg <36528214+markblundeberg@users.noreply.github.com> committed rABC22961ed53191: better error message for mandatory-flag tx rejections (authored by Mark Lundeberg <36528214+markblundeberg@users.noreply.github.com>).Aug 8 2019, 16:44