Closed fiatjaf closed 4 years ago
I'm assuming that you are returning a {"result": "fail", "failure_code": "400F"}
, which uses the deprecated failure_code
key instead of the newer failure_message
. If this is the case then this is working as expected:
lightningd
cannot build a value error from just the failcode
, since some errors require additional information (in the case of PERM|15
the payload consists of a htlc_msat
and a height
which is not specified by just returning the 2 byte failcode
400F
). Since the error message is not specification compliant without the payload we opted to map errors with incomplete payloads to a generic NODE|2
, which does not require a payload to be valid:
If you want to return PERM|15
= 16399 you have to return {"result": "fail", "failure_code": "400F010203040506070809000102"}
which is a fully valid error message with htlc_msat=0102030405060708
and height=09000102
.
I added #4084 to replicate this behavior and make sure it's correct.
Note that you should be doing development with 'enable-deprecated-apis=false' so you'd find such depreciation before it bites you...
Thank you very much for clarifying!
Issue and Steps to Reproduce
I'm returning failure code
16399
fromhtlc_accepted
(which corresponds toINCORRECT_OR_UNKNOWN_PAYMENT_DETAILS
), but this message is showing up in the logs:I must return that error specifically because it is expected by a bunch of softly-malicious wallets that perform pre-payment probes automatically on every payment using unknown hashes and expect that exact failure code in order to continue with the payment proper.
getinfo
output