2019-01-11 22:39:18 +01:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
|
2020-02-11 23:04:21 +01:00
|
|
|
from pyln.client import Plugin
|
2019-01-11 22:39:18 +01:00
|
|
|
|
|
|
|
|
plugin = Plugin()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@plugin.hook("htlc_accepted")
|
2019-08-05 02:19:48 +02:00
|
|
|
def on_htlc_accepted(onion, plugin, **kwargs):
|
2019-01-11 22:39:18 +01:00
|
|
|
plugin.log("Failing htlc on purpose")
|
|
|
|
|
plugin.log("onion: %r" % (onion))
|
2020-02-21 15:40:45 +10:30
|
|
|
# WIRE_TEMPORARY_NODE_FAILURE = 0x2002
|
|
|
|
|
return {"result": "fail", "failure_message": "2002"}
|
2019-01-11 22:39:18 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
plugin.run()
|