diff options
author | MarcoFalke <falke.marco@gmail.com> | 2017-11-08 13:43:28 -0500 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2018-07-11 10:32:25 -0400 |
commit | fa4bf92be9420919c74cdde9a973f7327d01ac88 (patch) | |
tree | c6e0a7c1502f19e9807fde78b7e479e9e1b48def | |
parent | b05ded176466dde1cf06b21834afcc46824eabb3 (diff) |
Remove dead service bits code
-rw-r--r-- | src/net_processing.cpp | 11 | ||||
-rwxr-xr-x | test/functional/p2p_leak.py | 27 | ||||
-rwxr-xr-x | test/functional/test_framework/messages.py | 2 |
3 files changed, 1 insertions, 39 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp index 458e9c2e9f..b719668867 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -1630,17 +1630,6 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr return false; } - if (nServices & ((1 << 7) | (1 << 5))) { - if (GetTime() < 1533096000) { - // Immediately disconnect peers that use service bits 6 or 8 until August 1st, 2018 - // These bits have been used as a flag to indicate that a node is running incompatible - // consensus rules instead of changing the network magic, so we're stuck disconnecting - // based on these service bits, at least for a while. - pfrom->fDisconnect = true; - return false; - } - } - if (nVersion < MIN_PEER_PROTO_VERSION) { // disconnect from peers older than this proto version diff --git a/test/functional/p2p_leak.py b/test/functional/p2p_leak.py index ecb9a56fe1..186c35e0e1 100755 --- a/test/functional/p2p_leak.py +++ b/test/functional/p2p_leak.py @@ -8,11 +8,7 @@ A node should never send anything other than VERSION/VERACK/REJECT until it's received a VERACK. This test connects to a node and sends it a few messages, trying to entice it -into sending us something it shouldn't. - -Also test that nodes that send unsupported service bits to bitcoind are disconnected -and don't receive a VERACK. Unsupported service bits are currently 1 << 5 and -1 << 7 (until August 1st 2018).""" +into sending us something it shouldn't.""" from test_framework.mininode import * from test_framework.test_framework import BitcoinTestFramework @@ -95,19 +91,13 @@ class P2PLeakTest(BitcoinTestFramework): self.extra_args = [['-banscore='+str(banscore)]] def run_test(self): - self.nodes[0].setmocktime(1501545600) # August 1st 2017 - no_version_bannode = self.nodes[0].add_p2p_connection(CNodeNoVersionBan(), send_version=False) no_version_idlenode = self.nodes[0].add_p2p_connection(CNodeNoVersionIdle(), send_version=False) no_verack_idlenode = self.nodes[0].add_p2p_connection(CNodeNoVerackIdle()) - unsupported_service_bit5_node = self.nodes[0].add_p2p_connection(CLazyNode(), services=NODE_NETWORK|NODE_UNSUPPORTED_SERVICE_BIT_5) - unsupported_service_bit7_node = self.nodes[0].add_p2p_connection(CLazyNode(), services=NODE_NETWORK|NODE_UNSUPPORTED_SERVICE_BIT_7) wait_until(lambda: no_version_bannode.ever_connected, timeout=10, lock=mininode_lock) wait_until(lambda: no_version_idlenode.ever_connected, timeout=10, lock=mininode_lock) wait_until(lambda: no_verack_idlenode.version_received, timeout=10, lock=mininode_lock) - wait_until(lambda: unsupported_service_bit5_node.ever_connected, timeout=10, lock=mininode_lock) - wait_until(lambda: unsupported_service_bit7_node.ever_connected, timeout=10, lock=mininode_lock) # Mine a block and make sure that it's not sent to the connected nodes self.nodes[0].generate(1) @@ -118,10 +108,6 @@ class P2PLeakTest(BitcoinTestFramework): #This node should have been banned assert not no_version_bannode.is_connected - # These nodes should have been disconnected - assert not unsupported_service_bit5_node.is_connected - assert not unsupported_service_bit7_node.is_connected - self.nodes[0].disconnect_p2ps() # Wait until all connections are closed @@ -131,17 +117,6 @@ class P2PLeakTest(BitcoinTestFramework): assert(no_version_bannode.unexpected_msg == False) assert(no_version_idlenode.unexpected_msg == False) assert(no_verack_idlenode.unexpected_msg == False) - assert not unsupported_service_bit5_node.unexpected_msg - assert not unsupported_service_bit7_node.unexpected_msg - - self.log.info("Service bits 5 and 7 are allowed after August 1st 2018") - self.nodes[0].setmocktime(1533168000) # August 2nd 2018 - - allowed_service_bit5_node = self.nodes[0].add_p2p_connection(P2PInterface(), services=NODE_NETWORK|NODE_UNSUPPORTED_SERVICE_BIT_5) - allowed_service_bit7_node = self.nodes[0].add_p2p_connection(P2PInterface(), services=NODE_NETWORK|NODE_UNSUPPORTED_SERVICE_BIT_7) - - wait_until(lambda: allowed_service_bit5_node.message_count["verack"], lock=mininode_lock) - wait_until(lambda: allowed_service_bit7_node.message_count["verack"], lock=mininode_lock) if __name__ == '__main__': diff --git a/test/functional/test_framework/messages.py b/test/functional/test_framework/messages.py index df8d424d01..af57e61f2f 100755 --- a/test/functional/test_framework/messages.py +++ b/test/functional/test_framework/messages.py @@ -42,8 +42,6 @@ NODE_NETWORK = (1 << 0) # NODE_GETUTXO = (1 << 1) NODE_BLOOM = (1 << 2) NODE_WITNESS = (1 << 3) -NODE_UNSUPPORTED_SERVICE_BIT_5 = (1 << 5) -NODE_UNSUPPORTED_SERVICE_BIT_7 = (1 << 7) NODE_NETWORK_LIMITED = (1 << 10) MSG_TX = 1 |