aboutsummaryrefslogtreecommitdiff
path: root/test/functional/p2p_invalid_tx.py
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2018-09-08 06:56:51 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2018-09-08 07:09:07 +0200
commitcb25cd6aa18c69918176d68e36e26f7e373aa48c (patch)
treee16c2ff568a97530210b3deffb129a1d392084f0 /test/functional/p2p_invalid_tx.py
parenteea87ef537b8ef38023e63c306ac163791f6eb66 (diff)
parentfac3e22b18cd29053bc17065fd75db7b84ba6f40 (diff)
Merge #14119: qa: Read reject reasons from debug log, not p2p messages
fac3e22b18cd29053bc17065fd75db7b84ba6f40 qa: Read reject reasons from debug log, not p2p messages (MarcoFalke) Pull request description: For local testing we don't need to rely on p2p messages just to assert a reject reason. Replace reading p2p messages with reading from the debug log file. Tree-SHA512: fa59598ecf5e00cfb420ef1892d90aa415501fd882e1c608894dc577b0d00e93a442326d3a9167fef77d26aafbe345b730b49109982ccad68a5942384564a90b
Diffstat (limited to 'test/functional/p2p_invalid_tx.py')
-rwxr-xr-xtest/functional/p2p_invalid_tx.py15
1 files changed, 2 insertions, 13 deletions
diff --git a/test/functional/p2p_invalid_tx.py b/test/functional/p2p_invalid_tx.py
index 40373689de..69d5dd9f9a 100755
--- a/test/functional/p2p_invalid_tx.py
+++ b/test/functional/p2p_invalid_tx.py
@@ -116,7 +116,8 @@ class InvalidTxRequestTest(BitcoinTestFramework):
assert_equal(2, len(node.getpeerinfo())) # p2ps[1] is still connected
self.log.info('Send the withhold tx ... ')
- node.p2p.send_txs_and_test([tx_withhold], node, success=True)
+ with node.assert_debug_log(expected_msgs=["bad-txns-in-belowout"]):
+ node.p2p.send_txs_and_test([tx_withhold], node, success=True)
# Transactions that should end up in the mempool
expected_mempool = {
@@ -134,18 +135,6 @@ class InvalidTxRequestTest(BitcoinTestFramework):
wait_until(lambda: 1 == len(node.getpeerinfo()), timeout=12) # p2ps[1] is no longer connected
assert_equal(expected_mempool, set(node.getrawmempool()))
- # restart node with sending BIP61 messages disabled, check that it disconnects without sending the reject message
- self.log.info('Test a transaction that is rejected, with BIP61 disabled')
- self.restart_node(0, ['-enablebip61=0', '-persistmempool=0'])
- self.reconnect_p2p(num_connections=1)
- with node.assert_debug_log(expected_msgs=[
- "{} from peer=0 was not accepted: mandatory-script-verify-flag-failed (Invalid OP_IF construction) (code 16)".format(tx1.hash),
- "disconnecting peer=0",
- ]):
- node.p2p.send_txs_and_test([tx1], node, success=False, expect_disconnect=True)
- # send_txs_and_test will have waited for disconnect, so we can safely check that no reject has been received
- assert_equal(node.p2p.reject_code_received, None)
-
if __name__ == '__main__':
InvalidTxRequestTest().main()