Changeset View
Changeset View
Standalone View
Standalone View
test/functional/p2p_invalid_tx.py
Show First 20 Lines • Show All 163 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
# tx_orphan_no_fee, because it has too low fee (p2ps[0] is not disconnected for relaying that tx) | # tx_orphan_no_fee, because it has too low fee (p2ps[0] is not disconnected for relaying that tx) | ||||
# tx_orphan_invaid, because it has negative fee (p2ps[1] is | # tx_orphan_invaid, because it has negative fee (p2ps[1] is | ||||
# disconnected for relaying that tx) | # disconnected for relaying that tx) | ||||
# p2ps[1] is no longer connected | # p2ps[1] is no longer connected | ||||
wait_until(lambda: 1 == len(node.getpeerinfo()), timeout=12) | wait_until(lambda: 1 == len(node.getpeerinfo()), timeout=12) | ||||
assert_equal(expected_mempool, set(node.getrawmempool())) | 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, self.extra_args[0] + ['-enablebip61=0', '-persistmempool=0']) | |||||
self.reconnect_p2p(num_connections=1) | |||||
node.p2p.send_txs_and_test( | |||||
[tx1], node, success=False, reject_reason="{} from peer=0 was not accepted: mandatory-script-verify-flag-failed (Invalid OP_IF construction) (code 16)".format(tx1.hash), expect_disconnect=True) | |||||
if __name__ == '__main__': | if __name__ == '__main__': | ||||
InvalidTxRequestTest().main() | InvalidTxRequestTest().main() |