mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 23:54:22 +01:00
plugin: Ensure RPC passthrough calls are terminated when plugin dies
We now track all pending RPC passthrough calls, and terminate them with an error if the plugin dies. Changelog-Fixed: JSON-RPC: Pending RPC method calls are now terminated if the handling plugin exits prematurely.
This commit is contained in:
committed by
Rusty Russell
parent
7ae8e21247
commit
197a144505
@@ -7,6 +7,12 @@ import sys
|
||||
plugin = Plugin()
|
||||
|
||||
|
||||
@plugin.async_method('hold-rpc-call')
|
||||
def hold_rpc_call(plugin, request):
|
||||
"""Simply never return, it should still get an error when the plugin crashes
|
||||
"""
|
||||
|
||||
|
||||
@plugin.hook('htlc_accepted')
|
||||
def on_htlc_accepted(plugin, htlc, onion, **kwargs):
|
||||
"""We die silently, i.e., without returning a response
|
||||
|
||||
Reference in New Issue
Block a user