diff options
author | instagibbs <gsanders87@gmail.com> | 2016-08-16 15:45:42 -0400 |
---|---|---|
committer | Luke Dashjr <luke-jr+git@utopios.org> | 2016-09-21 02:43:47 +0000 |
commit | a114a0208b2c01d85f413e48569edc4f5ec0951a (patch) | |
tree | b834a104abf08912b040fe8e59748b04445b176e /qa/rpc-tests | |
parent | 3606b6b3a7fed177d8039f3b8f45eb0e48e9db92 (diff) |
p2psegwit.py transaction is rejected due to premature witness not size
Github-Pull: #8528
Rebased-From: 5547aeb0159027912069b4773184963f54c672af
Diffstat (limited to 'qa/rpc-tests')
-rwxr-xr-x | qa/rpc-tests/p2p-segwit.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/qa/rpc-tests/p2p-segwit.py b/qa/rpc-tests/p2p-segwit.py index 3813743e5b..68d8b9a006 100755 --- a/qa/rpc-tests/p2p-segwit.py +++ b/qa/rpc-tests/p2p-segwit.py @@ -302,13 +302,18 @@ class SegWitTest(BitcoinTestFramework): sync_blocks(self.nodes) # We'll add an unnecessary witness to this transaction that would cause - # it to be too large according to IsStandard. + # it to be non-standard, to test that violating policy with a witness before + # segwit activation doesn't blind a node to a transaction. Transactions + # rejected for having a witness before segwit activation shouldn't be added + # to the rejection cache. tx3 = CTransaction() tx3.vin.append(CTxIn(COutPoint(tx2.sha256, 0), CScript([p2sh_program]))) tx3.vout.append(CTxOut(tx2.vout[0].nValue-1000, scriptPubKey)) tx3.wit.vtxinwit.append(CTxInWitness()) tx3.wit.vtxinwit[0].scriptWitness.stack = [b'a'*400000] tx3.rehash() + # Note that this should be rejected for the premature witness reason, + # rather than a policy check, since segwit hasn't activated yet. self.std_node.test_transaction_acceptance(tx3, True, False, b'no-witness-yet') # If we send without witness, it should be accepted. |