Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make GetFailureMsgData format non-printable error messages
Some lightning implementations will send non-printable data in error messages. For instance outdated versions of lnd will do this: lightningnetwork/lnd@ff37b71 Whereas these are the error codes (sent as single-byte error messages): https://github.com/lightningnetwork/lnd/blob/9b1ecbd3fa3fd93a6d95a5f71921c73777340760/lnwire/error.go#L12 These errors need to be printed as bytes when displayed to the user, rather than interpretted as strings. Error.GetFailureMsgData will now checks whether an error message is printable before returning the message as a string and, if it's not, returns a string containing the hex-encoded binary data in the error.
- Loading branch information