From bcc94b2d43b1765ffc40a9b7ff1ed6865a283cac Mon Sep 17 00:00:00 2001 From: Vincenzo Palazzo Date: Thu, 23 Feb 2023 15:52:27 +0100 Subject: [PATCH] fix: do not send send peerstorage msg when disabled This commit will disable the peerstorage plugins when the feature is not enabled. I found this issue with lnprototest, and I guess we did not find it with normal run because other the unknown messages are ingored? Changelog-Fixed: Disable the protocol messages when peerstorage is disabled. Signed-off-by: Vincenzo Palazzo --- plugins/chanbackup.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/chanbackup.c b/plugins/chanbackup.c index bf906b7ed..53be60395 100644 --- a/plugins/chanbackup.c +++ b/plugins/chanbackup.c @@ -346,6 +346,9 @@ static struct command_result *peer_after_listdatastore(struct command *cmd, return command_hook_success(cmd); struct out_req *req; + if (!peer_backup) + return command_hook_success(cmd); + u8 *payload = towire_your_peer_storage(cmd, hexdata); plugin_log(cmd->plugin, LOG_DBG, @@ -443,7 +446,7 @@ static struct command_result *after_listpeers(struct command *cmd, json_to_bool(buf, json_get_member(buf, peer, "connected"), &is_connected); - if (is_connected) { + if (is_connected && peer_backup) { const jsmntok_t *nodeid; struct node_id node_id;