plugins: support failure_message in invoice and htlc_accepted hooks.

As promised in the Changelog when we converted from failcodes to messages
internally.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2020-02-21 15:40:45 +10:30
parent c9e73dc4e0
commit faac4b28ad
5 changed files with 91 additions and 83 deletions

View File

@@ -9,9 +9,8 @@ plugin = Plugin()
def on_htlc_accepted(onion, plugin, **kwargs):
plugin.log("Failing htlc on purpose")
plugin.log("onion: %r" % (onion))
# FIXME: Define this!
WIRE_TEMPORARY_NODE_FAILURE = 0x2002
return {"result": "fail", "failure_code": WIRE_TEMPORARY_NODE_FAILURE}
# WIRE_TEMPORARY_NODE_FAILURE = 0x2002
return {"result": "fail", "failure_message": "2002"}
plugin.run()