[qa] Improve prioritisetransaction functional test
[bitcoinplatinum.git] / test / functional / p2p-mempool.py
blob168f9f685a1714293555aeba04fd0386937b783f
1 #!/usr/bin/env python3
2 # Copyright (c) 2015-2016 The Bitcoin Core developers
3 # Distributed under the MIT software license, see the accompanying
4 # file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 """Test p2p mempool message.
7 Test that nodes are disconnected if they send mempool messages when bloom
8 filters are not enabled.
9 """
11 from test_framework.mininode import *
12 from test_framework.test_framework import BitcoinTestFramework
13 from test_framework.util import *
15 class P2PMempoolTests(BitcoinTestFramework):
16 def set_test_params(self):
17 self.setup_clean_chain = True
18 self.num_nodes = 1
19 self.extra_args = [["-peerbloomfilters=0"]]
21 def run_test(self):
22 # Add a p2p connection
23 self.nodes[0].add_p2p_connection(P2PInterface())
24 network_thread_start()
25 self.nodes[0].p2p.wait_for_verack()
27 #request mempool
28 self.nodes[0].p2p.send_message(msg_mempool())
29 self.nodes[0].p2p.wait_for_disconnect()
31 #mininode must be disconnected at this point
32 assert_equal(len(self.nodes[0].getpeerinfo()), 0)
34 if __name__ == '__main__':
35 P2PMempoolTests().main()