@@ -314,6 +314,8 @@ def decode_simple(self, char="v"):
314314
315315 def bm_command_error (self ):
316316 """Decode an error message and log it"""
317+ if config .safeGetBoolean ('bootstrap' , 'commands' ):
318+ return
317319 err_values = self .decode_payload_content ("vvlsls" )
318320 fatalStatus = err_values [0 ]
319321 # banTime = err_values[1]
@@ -330,6 +332,8 @@ def bm_command_getdata(self):
330332 If we have them and some other conditions are fulfilled,
331333 append them to the write queue.
332334 """
335+ if config .safeGetBoolean ('bootstrap' , 'commands' ):
336+ return
333337 items = self .decode_payload_content ("l32s" )
334338 # skip?
335339 now = time .time ()
@@ -366,14 +370,20 @@ def _command_inv(self, extend_dandelion_stem=False):
366370
367371 def bm_command_inv (self ):
368372 """Non-dandelion announce"""
373+ if config .safeGetBoolean ('bootstrap' , 'commands' ):
374+ return
369375 return self ._command_inv (False )
370376
371377 def bm_command_dinv (self ):
372378 """Dandelion stem announce"""
379+ if config .safeGetBoolean ('bootstrap' , 'commands' ):
380+ return
373381 return self ._command_inv (True )
374382
375383 def bm_command_object (self ):
376384 """Incoming object, process it"""
385+ if config .safeGetBoolean ('bootstrap' , 'commands' ):
386+ return
377387 objectOffset = self .payloadOffset
378388 nonce , expiresTime , objectType , version , streamNumber = \
379389 self .decode_payload_content ("QQIvv" )
@@ -443,6 +453,8 @@ def _decode_addr(self):
443453
444454 def bm_command_addr (self ):
445455 """Incoming addresses, process them"""
456+ if config .safeGetBoolean ('bootstrap' , 'commands' ):
457+ return
446458 # not using services
447459 for seenTime , stream , _ , ip , port in self ._decode_addr ():
448460 ip = bytes (ip )
@@ -474,6 +486,8 @@ def bm_command_addr(self):
474486
475487 def bm_command_portcheck (self ):
476488 """Incoming port check request, queue it."""
489+ if config .safeGetBoolean ('bootstrap' , 'commands' ):
490+ return
477491 if self .isOutbound or self .portCheckRequested :
478492 return True
479493 self .portCheckRequested = True
@@ -483,6 +497,8 @@ def bm_command_portcheck(self):
483497
484498 def bm_command_ping (self ):
485499 """Incoming ping, respond to it."""
500+ if config .safeGetBoolean ('bootstrap' , 'commands' ):
501+ return
486502 self .append_write_buf (protocol .CreatePacket ('pong' ))
487503 return True
488504
@@ -603,7 +619,8 @@ def peerValidityChecks(self):
603619 ' interest in streams.' , self .destination )
604620 return False
605621 if self .pool .inboundConnections .get (
606- self .destination ):
622+ self .destination ) and not \
623+ config .safeGetBoolean ('bootstrap' , 'dup_ip' ):
607624 try :
608625 if not protocol .checkSocksIP (self .destination .host ):
609626 self .append_write_buf (protocol .assembleErrorMessage (
0 commit comments