Skip to content

Commit 1b96a3c

Browse files
committed
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 1bb5d51.
1 parent 638239d commit 1b96a3c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/test/transaction_tests.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -831,6 +831,7 @@ BOOST_AUTO_TEST_CASE(test_IsStandard)
831831
reason.clear();
832832
BOOST_CHECK(!IsStandardTx(CTransaction(t), reason));
833833
BOOST_CHECK_EQUAL(reason, "bare-multisig");
834+
fIsBareMultisigStd = DEFAULT_PERMIT_BAREMULTISIG;
834835
}
835836

836837
BOOST_AUTO_TEST_SUITE_END()

0 commit comments

Comments
 (0)