2019-05-31 08:30:19 +01:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
"""Simple plugin to allow testing while closing of HTLC is delayed.
|
|
|
|
"""
|
|
|
|
|
2020-02-11 22:04:21 +00:00
|
|
|
from pyln.client import Plugin
|
2019-05-31 08:30:19 +01:00
|
|
|
import time
|
|
|
|
|
|
|
|
plugin = Plugin()
|
|
|
|
|
|
|
|
|
|
|
|
@plugin.hook('invoice_payment')
|
2019-08-05 01:19:48 +01:00
|
|
|
def on_payment(payment, plugin, **kwargs):
|
2019-05-31 08:30:19 +01:00
|
|
|
time.sleep(float(plugin.get_option('holdtime')))
|
2020-01-31 11:50:37 +00:00
|
|
|
return {'result': 'continue'}
|
2019-05-31 08:30:19 +01:00
|
|
|
|
|
|
|
|
|
|
|
plugin.add_option('holdtime', '10', 'The time to hold invoice for.')
|
|
|
|
plugin.run()
|