diff --git a/test/functional/node_network_limited.py b/test/functional/node_network_limited.py --- a/test/functional/node_network_limited.py +++ b/test/functional/node_network_limited.py @@ -3,7 +3,7 @@ # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.messages import CInv, msg_getdata, msg_verack -from test_framework.mininode import NetworkThread, P2PInterface +from test_framework.mininode import NODE_BLOOM, NODE_NETWORK_LIMITED, NODE_BITCOIN_CASH, NetworkThread, P2PInterface from test_framework.test_framework import BitcoinTestFramework from test_framework.util import assert_equal @@ -50,13 +50,9 @@ node.wait_for_disconnect() def run_test(self): - # NODE_BLOOM & NODE_WITNESS & NODE_NETWORK_LIMITED must now be signaled - # 1060 == 0x424 == 0100 0010 0100 - # | | | - # | | ^--- NODE_BLOOM - # | ^---- NODE_BITCOIN_CASH - # ^-- NODE_NETWORK_LIMITED - assert_equal(self.get_signalled_service_flags(), 1060) + # NODE_BLOOM & NODE_BITCOIN_CASH & NODE_NETWORK_LIMITED must now be signaled + assert_equal(self.get_signalled_service_flags(), + NODE_BLOOM | NODE_BITCOIN_CASH | NODE_NETWORK_LIMITED) # Now mine some blocks over the NODE_NETWORK_LIMITED + 2(racy buffer ext.) target firstblock = self.nodes[0].generate(1)[0] @@ -74,11 +70,12 @@ # NODE_NETWORK_LIMITED must still be signaled after restart self.restart_node(0) - assert_equal(self.get_signalled_service_flags(), 1060) + assert_equal(self.get_signalled_service_flags(), + NODE_BLOOM | NODE_BITCOIN_CASH | NODE_NETWORK_LIMITED) # Test the RPC service flags - assert_equal(self.nodes[0].getnetworkinfo()[ - 'localservices'], "0000000000000424") + assert_equal(int(self.nodes[0].getnetworkinfo()[ + 'localservices'], 16), NODE_BLOOM | NODE_BITCOIN_CASH | NODE_NETWORK_LIMITED) # getdata a block above the NODE_NETWORK_LIMITED threshold must be possible self.try_get_block_via_getdata(block_within_limited_range, False) diff --git a/test/functional/test_framework/messages.py b/test/functional/test_framework/messages.py --- a/test/functional/test_framework/messages.py +++ b/test/functional/test_framework/messages.py @@ -41,10 +41,11 @@ NODE_NETWORK = (1 << 0) # NODE_GETUTXO = (1 << 1) -# NODE_BLOOM = (1 << 2) +NODE_BLOOM = (1 << 2) NODE_WITNESS = (1 << 3) NODE_XTHIN = (1 << 4) NODE_BITCOIN_CASH = (1 << 5) +NODE_NETWORK_LIMITED = (1 << 10) # Howmuch data will be read from the network at once READ_BUFFER_SIZE = 8192