Handle bad trustedpeer setting

This commit is contained in:
Dmitri Bogomolov 2019-06-07 13:54:47 +03:00
parent f868c1ad11
commit 29f9cd9545
Signed by untrusted user: g1itch
GPG Key ID: 720A756F18DEED13
1 changed files with 7 additions and 2 deletions

View File

@ -31,8 +31,13 @@ def _loadTrustedPeer():
# This probably means the trusted peer wasn't specified so we
# can just leave it as None
return
host, port = trustedPeer.split(':')
try:
host, port = trustedPeer.split(':')
except ValueError:
sys.exit(
'Bad trustedpeer config setting! It should be set as'
' trustedpeer=<hostname>:<portnumber>'
)
state.trustedPeer = state.Peer(host, int(port))