connectd: add own err codes instead of generic -1

Make it possible for connectd to send an error code to lightningd in
addition to the error message. Introduce two new error codes, replacing
the catch-all -1.

This change, together with
https://github.com/ElementsProject/lightning/pull/3395
will implement https://github.com/ElementsProject/lightning/issues/3366

Changelog-Changed: The `connect` command now returns its own error codes instead of a generic -1.
This commit is contained in:
Vasil Dimov
2020-01-05 18:17:25 +01:00
committed by Christian Decker
parent 3cf91b23b9
commit fc75d8a9e6
6 changed files with 71 additions and 20 deletions

View File

@@ -44,6 +44,10 @@
#define FUNDING_PEER_NOT_CONNECTED 305
#define FUNDING_UNKNOWN_PEER 306
/* `connect` errors */
#define CONNECT_NO_KNOWN_ADDRESS 400
#define CONNECT_ALL_ADDRESSES_FAILED 401
/* Errors from `invoice` command */
#define INVOICE_LABEL_ALREADY_EXISTS 900
#define INVOICE_PREIMAGE_ALREADY_EXISTS 901