You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1.1 KiB
36 lines
1.1 KiB
![]()
8 years ago
|
#!/usr/bin/env python3
|
||
![]()
7 years ago
|
# Copyright (c) 2015-2017 The Bitcoin Core developers
|
||
![]()
8 years ago
|
# Distributed under the MIT software license, see the accompanying
|
||
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||
![]()
8 years ago
|
"""Test p2p mempool message.
|
||
|
|
||
|
Test that nodes are disconnected if they send mempool messages when bloom
|
||
|
filters are not enabled.
|
||
|
"""
|
||
![]()
8 years ago
|
|
||
|
from test_framework.mininode import *
|
||
|
from test_framework.test_framework import BitcoinTestFramework
|
||
|
from test_framework.util import *
|
||
|
|
||
|
class P2PMempoolTests(BitcoinTestFramework):
|
||
![]()
7 years ago
|
def set_test_params(self):
|
||
![]()
8 years ago
|
self.setup_clean_chain = True
|
||
![]()
8 years ago
|
self.num_nodes = 1
|
||
|
self.extra_args = [["-peerbloomfilters=0"]]
|
||
![]()
8 years ago
|
|
||
|
def run_test(self):
|
||
![]()
7 years ago
|
# Add a p2p connection
|
||
![]()
7 years ago
|
self.nodes[0].add_p2p_connection(P2PInterface())
|
||
![]()
7 years ago
|
network_thread_start()
|
||
![]()
7 years ago
|
self.nodes[0].p2p.wait_for_verack()
|
||
![]()
8 years ago
|
|
||
|
#request mempool
|
||
![]()
7 years ago
|
self.nodes[0].p2p.send_message(msg_mempool())
|
||
|
self.nodes[0].p2p.wait_for_disconnect()
|
||
![]()
8 years ago
|
|
||
|
#mininode must be disconnected at this point
|
||
|
assert_equal(len(self.nodes[0].getpeerinfo()), 0)
|
||
|
|
||
|
if __name__ == '__main__':
|
||
|
P2PMempoolTests().main()
|