aboutsummaryrefslogtreecommitdiff
path: root/qa/rpc-tests/p2p-segwit.py
diff options
context:
space:
mode:
authorinstagibbs <gsanders87@gmail.com>2016-08-18 12:04:33 -0400
committerWladimir J. van der Laan <laanwj@gmail.com>2016-09-26 16:42:27 +0200
commitb394a96396ce166bf2b519190fdc2a124f57eb5e (patch)
tree3b1cc3bb9f95a87f38b4372fc4b18a1299cc7832 /qa/rpc-tests/p2p-segwit.py
parent1672225670cd34e21e397968433d47e6997f9a5f (diff)
downloadbitcoin-b394a96396ce166bf2b519190fdc2a124f57eb5e.tar.xz
Add basic test for IsStandard witness transaction blinding
Github-Pull: #8525 Rebased-From: ca10a03addf70421893791c2c499e82fc494d60b
Diffstat (limited to 'qa/rpc-tests/p2p-segwit.py')
-rwxr-xr-xqa/rpc-tests/p2p-segwit.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/qa/rpc-tests/p2p-segwit.py b/qa/rpc-tests/p2p-segwit.py
index 68d8b9a006..8af46f0316 100755
--- a/qa/rpc-tests/p2p-segwit.py
+++ b/qa/rpc-tests/p2p-segwit.py
@@ -965,8 +965,24 @@ class SegWitTest(BitcoinTestFramework):
tx3 = CTransaction()
tx3.vin.append(CTxIn(COutPoint(tx2.sha256, 0), b""))
- tx3.vout.append(CTxOut(tx2.vout[0].nValue-1000, CScript([OP_TRUE])))
tx3.wit.vtxinwit.append(CTxInWitness())
+
+ # Add too-large for IsStandard witness and check that it does not enter reject filter
+ p2sh_program = CScript([OP_TRUE])
+ p2sh_pubkey = hash160(p2sh_program)
+ witness_program2 = CScript([b'a'*400000])
+ tx3.vout.append(CTxOut(tx2.vout[0].nValue-1000, CScript([OP_HASH160, p2sh_pubkey, OP_EQUAL])))
+ tx3.wit.vtxinwit[0].scriptWitness.stack = [witness_program2]
+ tx3.rehash()
+
+ # Node will not be blinded to the transaction
+ self.std_node.announce_tx_and_wait_for_getdata(tx3)
+ self.std_node.test_transaction_acceptance(tx3, True, False, b'tx-size')
+ self.std_node.announce_tx_and_wait_for_getdata(tx3)
+ self.std_node.test_transaction_acceptance(tx3, True, False, b'tx-size')
+
+ # Remove witness stuffing, instead add extra witness push on stack
+ tx3.vout[0] = CTxOut(tx2.vout[0].nValue-1000, CScript([OP_TRUE]))
tx3.wit.vtxinwit[0].scriptWitness.stack = [CScript([CScriptNum(1)]), witness_program ]
tx3.rehash()