diff options
author | fanquake <fanquake@gmail.com> | 2020-01-29 13:11:58 +0800 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2020-01-30 08:41:24 +0800 |
commit | 1b96a3cd1ebe725896f59614903184289fe62cf8 (patch) | |
tree | b4f053b219434d6631f2fd5f108b5467fc7c412a /src/test/transaction_tests.cpp | |
parent | 638239de7502eed57f3b800d9b488de85f00d391 (diff) |
tests: reset fIsBareMultisigStd after bare-multisig tests
The bug this fixes is two-part.
1.The fIsBareMultisigStd global is being reused by other tests,
i.e script_p2sh_tests(set), after being set to false.
2. The order our tests run in doesn't always? seem to be random,
which meant that the script_p2sh tests would only fail if they
were run in an order where transaction_tests ran first, mutating
the fIsBareMultisigStd global.
This doesn't seem to happen when running make check, but if you
run src/test/test_bitcoin and pass --random=99999, the failure
in script_p2sh:
test/script_p2sh_tests.cpp:200: error: in "script_p2sh_tests/set": txTo[1].IsStandard
will occur (on most systems).
The new test was introduced in 1bb5d517aa616c1d5b5801d2ea36a2de5fb61eba.
Diffstat (limited to 'src/test/transaction_tests.cpp')
-rw-r--r-- | src/test/transaction_tests.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/test/transaction_tests.cpp b/src/test/transaction_tests.cpp index 0939803953..fb45ce0ee6 100644 --- a/src/test/transaction_tests.cpp +++ b/src/test/transaction_tests.cpp @@ -831,6 +831,7 @@ BOOST_AUTO_TEST_CASE(test_IsStandard) reason.clear(); BOOST_CHECK(!IsStandardTx(CTransaction(t), reason)); BOOST_CHECK_EQUAL(reason, "bare-multisig"); + fIsBareMultisigStd = DEFAULT_PERMIT_BAREMULTISIG; } BOOST_AUTO_TEST_SUITE_END() |