test tor version, use address db for connections, create address db if it doesnt exist, more

This commit is contained in:
Kevin Froman 2018-02-22 03:33:30 -06:00
parent af24f16538
commit 155791be03
No known key found for this signature in database
GPG key ID: 0D414D0FE405B63B
5 changed files with 32 additions and 4 deletions

View file

@ -72,9 +72,11 @@ class Onionr:
os.mkdir('data/')
os.mkdir('data/blocks/')
if not os.path.exists('data/peers.db'):
if not os.path.exists(self.onionrCore.peerDB):
self.onionrCore.createPeerDB()
pass
if not os.path.exists(self.onionrCore.addressDB):
self.onionrCore.createAddressDB()
# Get configuration
self.config = configparser.ConfigParser()
@ -90,7 +92,7 @@ class Onionr:
randomPort = random.randint(1024, 65535)
if self.onionrUtils.checkPort(randomPort):
break
self.config['CLIENT'] = {'CLIENT HMAC': base64.b64encode(os.urandom(32)).decode('utf-8'), 'PORT': randomPort, 'API VERSION': API_VERSION}
self.config['CLIENT'] = {'participate': 'true', 'CLIENT HMAC': base64.b64encode(os.urandom(32)).decode('utf-8'), 'PORT': randomPort, 'API VERSION': API_VERSION}
with open('data/config.ini', 'w') as configfile:
self.config.write(configfile)