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.
11 from test_framework
.mininode
import *
12 from test_framework
.test_framework
import BitcoinTestFramework
13 from test_framework
.util
import *
15 class P2PMempoolTests(BitcoinTestFramework
):
19 self
.setup_clean_chain
= True
21 self
.extra_args
= [["-peerbloomfilters=0"]]
25 aTestNode
= NodeConnCB()
26 node
= NodeConn('127.0.0.1', p2p_port(0), self
.nodes
[0], aTestNode
)
27 aTestNode
.add_connection(node
)
28 NetworkThread().start()
29 aTestNode
.wait_for_verack()
32 aTestNode
.send_message(msg_mempool())
33 aTestNode
.wait_for_disconnect()
35 #mininode must be disconnected at this point
36 assert_equal(len(self
.nodes
[0].getpeerinfo()), 0)
38 if __name__
== '__main__':
39 P2PMempoolTests().main()