mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-01 03:24:41 +01:00
21 lines
365 B
Python
21 lines
365 B
Python
|
#!/usr/bin/env python3
|
||
|
|
||
|
from pyln.client import Plugin
|
||
|
import sys
|
||
|
|
||
|
|
||
|
plugin = Plugin()
|
||
|
|
||
|
|
||
|
@plugin.hook('htlc_accepted')
|
||
|
def on_htlc_accepted(plugin, htlc, onion, **kwargs):
|
||
|
"""We die silently, i.e., without returning a response
|
||
|
|
||
|
`lightningd` should detect that and recover.
|
||
|
"""
|
||
|
plugin.log("Plugin is about to crash...")
|
||
|
sys.exit(1)
|
||
|
|
||
|
|
||
|
plugin.run()
|