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

@@ -16,9 +16,8 @@ def on_payment(payment, plugin, **kwargs):
print("preimage={}".format(payment['preimage']))
if payment['preimage'].endswith('0'):
# FIXME: Define this!
WIRE_TEMPORARY_NODE_FAILURE = 0x2002
return {'failure_code': WIRE_TEMPORARY_NODE_FAILURE}
# WIRE_TEMPORARY_NODE_FAILURE = 0x2002
return {'failure_message': "2002"}
return {'result': 'continue'}