Skip to content

Commit

Permalink
Always allow new portget command
Browse files Browse the repository at this point in the history
May be required for protocol upgrade, postfork.
  • Loading branch information
EggPool authored Nov 9, 2019
1 parent 4180f03 commit c4a18ca
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion peershandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,11 @@ def is_allowed(self, peer_ip, command=''):
# Always allow whitelisted ip to post as block
if 'block' == command and self.is_whitelisted(peer_ip):
return True
# always allowed commands, only required and non cpu intensive.
if command in ('portget',):
return True
# only allow local host for "stop" and addpeers command
if command in ['stop', 'addpeers']:
if command in ('stop', 'addpeers'):
return peer_ip == '127.0.0.1'
return peer_ip in self.config.allowed or "any" in self.config.allowed

Expand Down

0 comments on commit c4a18ca

Please sign in to comment.