plugins/clnrest: disable ourselves unless rest-port is set.

This mirrors grpc's behavior, and avoids listening on ports without
explicit user permission.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2023-07-15 14:13:01 +09:30
parent abcfda133f
commit 2ab0b4af3e
4 changed files with 13 additions and 3 deletions

View File

@@ -110,7 +110,10 @@ def start_server():
@plugin.init()
def init(options, configuration, plugin):
set_config(options)
# We require options before we open a port.
err = set_config(options)
if err:
return {'disable': err}
start_server()