ensure we have an integer when we read max outgoing connections from disk

This commit is contained in:
Justin Ramos 2017-01-11 19:57:08 +00:00
parent 12f1e9f505
commit 37f69646e9

View File

@ -433,8 +433,16 @@ class sqlThread(threading.Thread):
BMConfigParser().set('bitmessagesettings', 'smtpdeliver', '')
if not BMConfigParser().has_option('bitmessagesettings', 'hidetrayconnectionnotifications'):
BMConfigParser().set('bitmessagesettings', 'hidetrayconnectionnotifications', 'false')
if not BMConfigParser().has_option('bitmessagesettings', 'maxoutboundconnections'):
if BMConfigParser().has_option('bitmessagesettings', 'maxoutboundconnections'):
try:
# Ensure we have an integer
int(float(BMConfigParser().get('bitmessagesettings', 'maxoutboundconnections')))
except:
logger.fatal('Your maximum outbound connections must be a number.')
os._exit(0)
else:
BMConfigParser().set('bitmessagesettings', 'maxoutboundconnections', '8')
shared.writeKeysFile()
# Are you hoping to add a new option to the keys.dat file of existing