mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-20 02:27:51 +01:00
19 lines
404 B
Python
Executable File
19 lines
404 B
Python
Executable File
#!/usr/bin/env python3
|
|
"""Simple plugin to allow testing while closing of HTLC is delayed.
|
|
"""
|
|
|
|
from lightning import Plugin
|
|
import time
|
|
|
|
plugin = Plugin()
|
|
|
|
|
|
@plugin.hook('invoice_payment')
|
|
def on_payment(payment, plugin, **kwargs):
|
|
time.sleep(float(plugin.get_option('holdtime')))
|
|
return {'result': 'continue'}
|
|
|
|
|
|
plugin.add_option('holdtime', '10', 'The time to hold invoice for.')
|
|
plugin.run()
|