allowing for max connection configuration #939
|
@ -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:
|
||||
And this should be And this should be
`except ValueException:`
because you're supposed to always name the exception. I haven't always done it but in new code we should try to do that.
|
||||
logger.fatal('Your maximum outbound connections must be a number.')
|
||||
This should simply log an error and set it to 8 instead of dying. This should simply log an error and set it to 8 instead of dying.
|
||||
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
|
||||
|
|
Reference in New Issue
Block a user
Maybe
if BMConfigParser().getint('bitmessagesettings', 'maxoutboundconnections'))) < 1: throw ValueException