mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
rpc: checkmessage return an error if pubkey is not found
Returning an warning message when the pub key is not specified and there is no node in the graph. We try to help people that use core lightning as a signer and nothings else. Changelog-Deprecated: rpc: checkmessage return an error when the pubkey is not specified and it is unknown in the network graph.
This commit is contained in:
committed by
Christian Decker
parent
5abed486d0
commit
1d671a2380
@@ -1,5 +1,6 @@
|
||||
#include "config.h"
|
||||
#include <common/bech32.h>
|
||||
#include <common/configdir.h>
|
||||
#include <common/json_command.h>
|
||||
#include <common/json_param.h>
|
||||
#include <errno.h>
|
||||
@@ -133,6 +134,12 @@ static void listnodes_done(const char *buffer,
|
||||
if (t)
|
||||
t = json_get_member(buffer, t, "nodes");
|
||||
|
||||
if (!deprecated_apis && (!t || t->size == 0)) {
|
||||
was_pending(command_fail(can->cmd, SIGNMESSAGE_PUBKEY_NOT_FOUND,
|
||||
"pub key not found in the graph, expected pubkey is %s",
|
||||
node_id_to_hexstr(tmpctx, &can->id)));
|
||||
return;
|
||||
}
|
||||
response = json_stream_success(can->cmd);
|
||||
json_add_node_id(response, "pubkey", &can->id);
|
||||
json_add_bool(response, "verified", t && t->size == 1);
|
||||
|
||||
Reference in New Issue
Block a user