Skip to content

Commit

Permalink
Add sanity check for joinable_funds_target value
Browse files Browse the repository at this point in the history
  • Loading branch information
LefterisJP committed Oct 5, 2018
1 parent 99ce7de commit 7c41bd5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion raiden/connection_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ def connect(
'The funds to use in the connection need to be a positive integer',
)

if joinable_funds_target < 0 or joinable_funds_target > 1:
raise InvalidAmount(
f'joinable_funds_target should be between 0 and 1. Given: {joinable_funds_target}',
)

with self.lock:
self.funds = funds
self.initial_channel_target = initial_channel_target
Expand Down Expand Up @@ -220,7 +225,7 @@ def join_channel(self, partner_address, partner_deposit):
)
except RaidenRecoverableError:
log.exception('connection manager join: channel not in opened state')
except InvalidDBData as e:
except InvalidDBData:
raise
except RaidenUnrecoverableError as e:
if self.raiden.config['network_type'] == NetworkType.MAIN:
Expand Down

0 comments on commit 7c41bd5

Please sign in to comment.