X-Git-Url: https://git.novaco.in/?p=electrum-server.git;a=blobdiff_plain;f=transports%2Fstratum_http.py;h=b9fe30c6cf1dd7e70cdf0fa922caf3105d45838a;hp=a7ef49d40bcb3b69d634bac3bad67f21e174d75e;hb=65383ca074c7ee02311df11d57ca42061177558e;hpb=fe46b9196fd5b039848bbe11d49f47d4701045eb diff --git a/transports/stratum_http.py b/transports/stratum_http.py index a7ef49d..b9fe30c 100644 --- a/transports/stratum_http.py +++ b/transports/stratum_http.py @@ -341,13 +341,14 @@ class HttpSession(Session): self.pending_responses.append(response) class HttpServer(threading.Thread): - def __init__(self, dispatcher, host, port): + def __init__(self, dispatcher, host, port, password): self.shared = dispatcher.shared self.dispatcher = dispatcher.request_dispatcher threading.Thread.__init__(self) self.daemon = True self.host = host self.port = port + self.password = password self.lock = threading.Lock() def run(self): @@ -373,8 +374,13 @@ class HttpServer(threading.Thread): self.dispatcher.process(session, request) def do_stop(self, session, request): - self.shared.stop() - return 'ok' + try: + password = request['params'][0] + except: + password = None + if password == self.password: + self.shared.stop() + return 'ok'