mirror of
https://github.com/aljazceru/plugins.git
synced 2025-12-25 17:04:20 +01:00
21 lines
433 B
Python
Executable File
21 lines
433 B
Python
Executable File
#!/usr/bin/env python3
|
|
"""Plugin that holds on to HTLCs for 5 seconds, then reject them."""
|
|
from pyln.client import Plugin
|
|
import time
|
|
|
|
plugin = Plugin()
|
|
|
|
|
|
@plugin.hook("htlc_accepted")
|
|
def on_htlc_accepted(htlc, onion, plugin, **kwargs):
|
|
time.sleep(5)
|
|
return {'result': 'fail', 'failure_message': '2002'}
|
|
|
|
|
|
@plugin.init()
|
|
def init(options, configuration, plugin):
|
|
plugin.log("hold_htlcs.py initializing")
|
|
|
|
|
|
plugin.run()
|