From 37f69646e9fd6b0a984c0443173e42b2aa08f335 Mon Sep 17 00:00:00 2001 From: Justin Ramos Date: Wed, 11 Jan 2017 19:57:08 +0000 Subject: [PATCH] ensure we have an integer when we read max outgoing connections from disk --- src/class_sqlThread.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/class_sqlThread.py b/src/class_sqlThread.py index 92aeb5d5..2ed37e59 100644 --- a/src/class_sqlThread.py +++ b/src/class_sqlThread.py @@ -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