2019-01-11 22:39:18 +01:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
|
|
|
|
|
from lightning import Plugin
|
|
|
|
|
|
|
|
|
|
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))
|
2019-09-05 22:43:07 +08:00
|
|
|
# FIXME: Define this!
|
|
|
|
|
WIRE_TEMPORARY_NODE_FAILURE = 0x2002
|
|
|
|
|
return {"result": "fail", "failure_code": WIRE_TEMPORARY_NODE_FAILURE}
|
2019-01-11 22:39:18 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
plugin.run()
|