Skip to content

Commit fa4bf92

Browse files
author
MarcoFalke
committed
Remove dead service bits code
1 parent b05ded1 commit fa4bf92

File tree

3 files changed

+1
-39
lines changed

3 files changed

+1
-39
lines changed

src/net_processing.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1630,17 +1630,6 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
16301630
return false;
16311631
}
16321632

1633-
if (nServices & ((1 << 7) | (1 << 5))) {
1634-
if (GetTime() < 1533096000) {
1635-
// Immediately disconnect peers that use service bits 6 or 8 until August 1st, 2018
1636-
// These bits have been used as a flag to indicate that a node is running incompatible
1637-
// consensus rules instead of changing the network magic, so we're stuck disconnecting
1638-
// based on these service bits, at least for a while.
1639-
pfrom->fDisconnect = true;
1640-
return false;
1641-
}
1642-
}
1643-
16441633
if (nVersion < MIN_PEER_PROTO_VERSION)
16451634
{
16461635
// disconnect from peers older than this proto version

test/functional/p2p_leak.py

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,7 @@
88
received a VERACK.
99
1010
This test connects to a node and sends it a few messages, trying to entice it
11-
into sending us something it shouldn't.
12-
13-
Also test that nodes that send unsupported service bits to bitcoind are disconnected
14-
and don't receive a VERACK. Unsupported service bits are currently 1 << 5 and
15-
1 << 7 (until August 1st 2018)."""
11+
into sending us something it shouldn't."""
1612

1713
from test_framework.mininode import *
1814
from test_framework.test_framework import BitcoinTestFramework
@@ -95,19 +91,13 @@ def set_test_params(self):
9591
self.extra_args = [['-banscore='+str(banscore)]]
9692

9793
def run_test(self):
98-
self.nodes[0].setmocktime(1501545600) # August 1st 2017
99-
10094
no_version_bannode = self.nodes[0].add_p2p_connection(CNodeNoVersionBan(), send_version=False)
10195
no_version_idlenode = self.nodes[0].add_p2p_connection(CNodeNoVersionIdle(), send_version=False)
10296
no_verack_idlenode = self.nodes[0].add_p2p_connection(CNodeNoVerackIdle())
103-
unsupported_service_bit5_node = self.nodes[0].add_p2p_connection(CLazyNode(), services=NODE_NETWORK|NODE_UNSUPPORTED_SERVICE_BIT_5)
104-
unsupported_service_bit7_node = self.nodes[0].add_p2p_connection(CLazyNode(), services=NODE_NETWORK|NODE_UNSUPPORTED_SERVICE_BIT_7)
10597

10698
wait_until(lambda: no_version_bannode.ever_connected, timeout=10, lock=mininode_lock)
10799
wait_until(lambda: no_version_idlenode.ever_connected, timeout=10, lock=mininode_lock)
108100
wait_until(lambda: no_verack_idlenode.version_received, timeout=10, lock=mininode_lock)
109-
wait_until(lambda: unsupported_service_bit5_node.ever_connected, timeout=10, lock=mininode_lock)
110-
wait_until(lambda: unsupported_service_bit7_node.ever_connected, timeout=10, lock=mininode_lock)
111101

112102
# Mine a block and make sure that it's not sent to the connected nodes
113103
self.nodes[0].generate(1)
@@ -118,10 +108,6 @@ def run_test(self):
118108
#This node should have been banned
119109
assert not no_version_bannode.is_connected
120110

121-
# These nodes should have been disconnected
122-
assert not unsupported_service_bit5_node.is_connected
123-
assert not unsupported_service_bit7_node.is_connected
124-
125111
self.nodes[0].disconnect_p2ps()
126112

127113
# Wait until all connections are closed
@@ -131,17 +117,6 @@ def run_test(self):
131117
assert(no_version_bannode.unexpected_msg == False)
132118
assert(no_version_idlenode.unexpected_msg == False)
133119
assert(no_verack_idlenode.unexpected_msg == False)
134-
assert not unsupported_service_bit5_node.unexpected_msg
135-
assert not unsupported_service_bit7_node.unexpected_msg
136-
137-
self.log.info("Service bits 5 and 7 are allowed after August 1st 2018")
138-
self.nodes[0].setmocktime(1533168000) # August 2nd 2018
139-
140-
allowed_service_bit5_node = self.nodes[0].add_p2p_connection(P2PInterface(), services=NODE_NETWORK|NODE_UNSUPPORTED_SERVICE_BIT_5)
141-
allowed_service_bit7_node = self.nodes[0].add_p2p_connection(P2PInterface(), services=NODE_NETWORK|NODE_UNSUPPORTED_SERVICE_BIT_7)
142-
143-
wait_until(lambda: allowed_service_bit5_node.message_count["verack"], lock=mininode_lock)
144-
wait_until(lambda: allowed_service_bit7_node.message_count["verack"], lock=mininode_lock)
145120

146121

147122
if __name__ == '__main__':

test/functional/test_framework/messages.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@
4242
# NODE_GETUTXO = (1 << 1)
4343
NODE_BLOOM = (1 << 2)
4444
NODE_WITNESS = (1 << 3)
45-
NODE_UNSUPPORTED_SERVICE_BIT_5 = (1 << 5)
46-
NODE_UNSUPPORTED_SERVICE_BIT_7 = (1 << 7)
4745
NODE_NETWORK_LIMITED = (1 << 10)
4846

4947
MSG_TX = 1

0 commit comments

Comments
 (0)