aboutsummaryrefslogtreecommitdiff
path: root/src/test/script_P2SH_tests.cpp
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2012-01-19 13:30:54 -0500
committerGavin Andresen <gavinandresen@gmail.com>2012-01-19 13:30:54 -0500
commit39f0d9686095bce469dbfa52333331a5d15c6545 (patch)
treecbbe1525c2faee1ba826c1a3ab6a8e36e95f7230 /src/test/script_P2SH_tests.cpp
parent43cda5f325f53e8941efa7f712aed66e3fde172a (diff)
Make transactions with extra data in their scriptSig's non-standard.
Diffstat (limited to 'src/test/script_P2SH_tests.cpp')
-rw-r--r--src/test/script_P2SH_tests.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test/script_P2SH_tests.cpp b/src/test/script_P2SH_tests.cpp
index aed3e23319..540019c739 100644
--- a/src/test/script_P2SH_tests.cpp
+++ b/src/test/script_P2SH_tests.cpp
@@ -293,6 +293,15 @@ BOOST_AUTO_TEST_CASE(AreInputsStandard)
BOOST_CHECK(txTo.AreInputsStandard(mapInputs));
+ // Make sure adding crap to the scriptSigs makes them non-standard:
+ for (int i = 0; i < 3; i++)
+ {
+ CScript t = txTo.vin[i].scriptSig;
+ txTo.vin[i].scriptSig = (CScript() << 11) + t;
+ BOOST_CHECK(!txTo.AreInputsStandard(mapInputs));
+ txTo.vin[i].scriptSig = t;
+ }
+
CTransaction txToNonStd;
txToNonStd.vout.resize(1);
txToNonStd.vout[0].scriptPubKey.SetBitcoinAddress(key[1].GetPubKey());