cln/tests/plugins/stop_sendpsbt.py
Rusty Russell 409beb6923 pytest: test failure if we crash after fundchannel_complete but before sendpsbt.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-11-19 07:23:39 +10:30

21 lines
426 B
Python
Executable file

#!/usr/bin/env python3
"""
This plugin is used to shutdown a node before processing the sendpsbt command
"""
from pyln.client import Plugin
import os
import signal
plugin = Plugin()
@plugin.hook("rpc_command")
def on_rpc_command(plugin, rpc_command, **kwargs):
request = rpc_command
if request["method"] == "sendpsbt":
os.kill(os.getppid(), signal.SIGKILL)
return {"result": "continue"}
plugin.run()