from common.bounty import *
from common.peers import *
from common import settings
from time import sleep
from common.safeprint import safeprint

def main():
    settings.setup()
    try:
        import miniupnpc
    except:
        settings.config['outbound'] = True
    safeprint("settings are:")
    safeprint(settings.config)
    ear = listener(settings.config['port'],settings.config['outbound'])
    ear.daemon = True
    ear.start()
    initializePeerConnections()
    
if __name__ == "__main__":
    main()

from common.bounty import *
from common.peers import *
from common import settings
from time import sleep
from common.safeprint import safeprint

def main():
    settings.setup()
    try:
        import miniupnpc
    except:
        settings.config['outbound'] = True
    safeprint("settings are:")
    safeprint(settings.config)
    ear = listener(settings.config['port'],settings.config['outbound'])
    ear.daemon = True
    ear.start()
    sleep(1)
    initializePeerConnections()
    
if __name__ == "__main__":
    main()

Add delay after listener start (for testing)
Add delay after listener start (for testing) [skip ci]
  from common.bounty import *
  from common.peers import *
  from common import settings
  from time import sleep
  from common.safeprint import safeprint
  
  def main():
      settings.setup()
      try:
          import miniupnpc
      except:
          settings.config['outbound'] = True
      safeprint("settings are:")
      safeprint(settings.config)
      ear = listener(settings.config['port'],settings.config['outbound'])
      ear.daemon = True
      ear.start()
+     sleep(1)
      initializePeerConnections()
      
  if __name__ == "__main__":
      main()
  
Add delay after listener start (for testing)
## Code Before:
from common.bounty import *
from common.peers import *
from common import settings
from time import sleep
from common.safeprint import safeprint

def main():
    settings.setup()
    try:
        import miniupnpc
    except:
        settings.config['outbound'] = True
    safeprint("settings are:")
    safeprint(settings.config)
    ear = listener(settings.config['port'],settings.config['outbound'])
    ear.daemon = True
    ear.start()
    initializePeerConnections()
    
if __name__ == "__main__":
    main()

## Instruction:
Add delay after listener start (for testing)
## Code After:
from common.bounty import *
from common.peers import *
from common import settings
from time import sleep
from common.safeprint import safeprint

def main():
    settings.setup()
    try:
        import miniupnpc
    except:
        settings.config['outbound'] = True
    safeprint("settings are:")
    safeprint(settings.config)
    ear = listener(settings.config['port'],settings.config['outbound'])
    ear.daemon = True
    ear.start()
    sleep(1)
    initializePeerConnections()
    
if __name__ == "__main__":
    main()
