From c4a18ca7cebae8fb3e0126deb9363a49d11443bd Mon Sep 17 00:00:00 2001 From: EggPool <33421807+EggPool@users.noreply.github.com> Date: Sat, 9 Nov 2019 11:17:13 +0100 Subject: [PATCH] Always allow new portget command May be required for protocol upgrade, postfork. --- peershandler.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/peershandler.py b/peershandler.py index 441f9e0..a2c1a0d 100644 --- a/peershandler.py +++ b/peershandler.py @@ -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