aboutsummaryrefslogtreecommitdiff
path: root/qa
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2016-09-13 11:02:46 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2016-09-13 11:03:06 +0200
commit4ced5de71d4d2b89aa616a599fc7dff6b230a3eb (patch)
tree6ac785fe89e8c8a5fef3227e37c33cca7dae8861 /qa
parent7e9ab9555cab6f256e48fdf98d0bfd961e526f7f (diff)
parent5547aeb0159027912069b4773184963f54c672af (diff)
downloadbitcoin-4ced5de71d4d2b89aa616a599fc7dff6b230a3eb.tar.xz
Merge #8528: Update p2p-segwit.py to reflect correct behavior
5547aeb p2psegwit.py transaction is rejected due to premature witness not size (instagibbs) bc1d1f2 Update p2p-segwit.py to reflect correct AskFor behavior (instagibbs)
Diffstat (limited to 'qa')
-rwxr-xr-xqa/rpc-tests/p2p-segwit.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/qa/rpc-tests/p2p-segwit.py b/qa/rpc-tests/p2p-segwit.py
index ca784644d8..22ec0ad8c8 100755
--- a/qa/rpc-tests/p2p-segwit.py
+++ b/qa/rpc-tests/p2p-segwit.py
@@ -305,13 +305,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.
@@ -949,8 +954,7 @@ class SegWitTest(BitcoinTestFramework):
self.test_node.test_transaction_acceptance(tx, with_witness=True, accepted=False)
# Verify that removing the witness succeeds.
- # Re-announcing won't result in a getdata for ~2.5 minutes, so just
- # deliver the modified transaction.
+ self.test_node.announce_tx_and_wait_for_getdata(tx)
self.test_node.test_transaction_acceptance(tx, with_witness=False, accepted=True)
# Now try to add extra witness data to a valid witness tx.