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

Details

Provenance
Mark Lundeberg <36528214+markblundeberg@users.noreply.github.com>Authored on Aug 6 2019, 19:59
jasonbcoxPushed on Aug 8 2019, 17:31
Reviewer
Restricted Project
Differential Revision
D3811: better error message for mandatory-flag tx rejections
Parents
rSTAGING4a608c655010: Merge #12537: [arith_uint256] Make it safe to use "self" in operators
Branches
Unknown
Tags
Unknown