Skip to content
Merged
10 changes: 6 additions & 4 deletions raiden/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,11 @@ def __init__(
)

# check that the settlement timeout fits the limits of the contract
settlement_timeout_min = default_registry.settlement_timeout_min("latest")
settlement_timeout_max = default_registry.settlement_timeout_max("latest")
invalid_settle_timeout = (
config["settle_timeout"] < default_registry.settlement_timeout_min()
or config["settle_timeout"] > default_registry.settlement_timeout_max()
config["settle_timeout"] < settlement_timeout_min
or config["settle_timeout"] > settlement_timeout_max
or config["settle_timeout"] < config["reveal_timeout"] * 2
)
if invalid_settle_timeout:
Expand All @@ -113,8 +115,8 @@ def __init__(
"be in range [{}, {}], is {}"
).format(
to_checksum_address(default_registry.address),
default_registry.settlement_timeout_min(),
default_registry.settlement_timeout_max(),
settlement_timeout_min,
settlement_timeout_max,
config["settle_timeout"],
)
)
Expand Down
12 changes: 12 additions & 0 deletions raiden/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,18 @@ class InvalidTokenAddress(RaidenError):
""" Raised if the token address is invalid """


class InvalidTokenNetworkDepositLimit(RaidenError):
""" Raised when an invalid token network deposit
limit is passed to the token network registry proxy.
"""
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can happen only when the API didn't check enough conditions. This should crash the node with BrokenPreconditionError.



class InvalidChannelParticipantDepositLimit(RaidenError):
""" Raised when an invalid channel participant
deposit limit is passed to the token network registry proxy.
"""
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can only happen when the API didn't check the condition. This situation should crash the node with BrokenPreconditionError.



class STUNUnavailableException(RaidenError):
pass

Expand Down
Loading