diff --git a/src/api.py b/src/api.py index de220cc4..b2833070 100644 --- a/src/api.py +++ b/src/api.py @@ -1117,10 +1117,8 @@ class BMRPCDispatcher(object): toAddress = addBMIfNotPresent(toAddress) fromAddress = addBMIfNotPresent(fromAddress) self._verifyAddress(fromAddress) - try: - fromAddressEnabled = self.config.getboolean( - fromAddress, 'enabled') - except BaseException: + fromAddressEnabled = self.config.safeGetBoolean(fromAddress, 'enabled') + if fromAddressEnabled is None: raise APIError( 13, 'Could not find your fromAddress in the keys.dat file.') if not fromAddressEnabled: @@ -1163,9 +1161,7 @@ class BMRPCDispatcher(object): TTL = 28 * 24 * 60 * 60 fromAddress = addBMIfNotPresent(fromAddress) self._verifyAddress(fromAddress) - try: - self.config.getboolean(fromAddress, 'enabled') - except BaseException: + if not self.config.safeGetBoolean(fromAddress, 'enabled'): raise APIError( 13, 'Could not find your fromAddress in the keys.dat file.') toAddress = str_broadcast_subscribers