connectd: make exception for peer storage msgs.

This commit is contained in:
adi2011 2023-02-02 20:31:24 +10:30 committed by Alex Myers
parent 66d98c327f
commit 709ff01fd2
2 changed files with 4 additions and 2 deletions

View file

@ -723,7 +723,7 @@ static bool handle_custommsg(struct daemon *daemon,
const u8 *msg)
{
enum peer_wire type = fromwire_peektype(msg);
if (type % 2 == 1 && !peer_wire_is_defined(type)) {
if (type % 2 == 1 && !peer_wire_is_internal(type)) {
/* The message is not part of the messages we know how to
* handle. Assuming this is a custommsg, we just forward it to the
* master. */

View file

@ -752,7 +752,9 @@ static struct command_result *json_sendcustommsg(struct command *cmd,
return command_param_failed();
type = fromwire_peektype(msg);
if (peer_wire_is_defined(type)) {
/* Allow peer_storage and your_peer_storage msgtypes */
if (peer_wire_is_internal(type)) {
return command_fail(
cmd, JSONRPC2_INVALID_REQUEST,
"Cannot send messages of type %d (%s). It is not possible "