mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 01:43:36 +01:00
lightningd: allow builtin plugins to be stopped.
These are automatically marked "important", in the sense that we won't startup if they are not working, but this wasn't meant to disallow stopping them. Changelog-Changed: JSON-RPC: built-in plugins can now be stopped using "plugin stop". Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
41e15b1ac9
commit
c93153ec37
@ -156,6 +156,8 @@ plugin_dynamic_stop(struct command *cmd, const char *plugin_name)
|
||||
"%s cannot be managed when "
|
||||
"lightningd is up",
|
||||
plugin_name);
|
||||
/* Don't freak out, even if it's a built-in */
|
||||
p->important = false;
|
||||
|
||||
/* If it's interested in clean shutdown, tell it. */
|
||||
if (notify_plugin_shutdown(cmd->ld, p)) {
|
||||
|
@ -4450,6 +4450,15 @@ def test_listchannels_broken_message(node_factory):
|
||||
l1.rpc.listchannels()
|
||||
|
||||
|
||||
def test_important_plugin_shutdown(node_factory):
|
||||
"""We can shutdown an important plugin (as long as it's dynamic) without dying"""
|
||||
|
||||
l1 = node_factory.get_node()
|
||||
|
||||
l1.rpc.plugin_stop("pay")
|
||||
l1.rpc.plugin_start(os.path.join(os.getcwd(), 'plugins/pay'))
|
||||
|
||||
|
||||
@unittest.skipIf(VALGRIND, "It does not play well with prompt and key derivation.")
|
||||
def test_exposesecret(node_factory):
|
||||
l1, l2 = node_factory.get_nodes(2, opts=[{'exposesecret-passphrase': "test_exposesecret"}, {}])
|
||||
|
Loading…
Reference in New Issue
Block a user