pyln-testing: add 'config' method to a node

Query for a config's value. If not set, returns 'none'
This commit is contained in:
niftynei
2020-12-09 18:06:49 -06:00
committed by Christian Decker
parent 327d9a3ff6
commit 3c1d90086f

View File

@@ -1043,6 +1043,13 @@ class LightningNode(object):
out = out[2 + length:] out = out[2 + length:]
return msgs return msgs
def config(self, config_name):
try:
opt = self.rpc.listconfigs(config_name)
return opt[config_name]
except RpcError:
return None
class Throttler(object): class Throttler(object):
"""Throttles the creation of system-processes to avoid overload. """Throttles the creation of system-processes to avoid overload.