offers: fix overzealous BROKEN log.

sendonionmessage can fail when sending a reply, either because
the reply had a bad first peer, or because it went offline.  The
latter happens in CI, which is how I found this.

Also fixed typo "onio" -> "onion".

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2021-10-13 10:57:11 +10:30
parent cd7d87f98e
commit 67220ca31d

View File

@@ -31,8 +31,10 @@ static struct command_result *sendonionmessage_error(struct command *cmd,
const jsmntok_t *err, const jsmntok_t *err,
void *unused) void *unused)
{ {
plugin_log(cmd->plugin, LOG_BROKEN, /* This can happen if the peer goes offline or wasn't directly
"sendoniomessage gave JSON error: %.*s", * connected: "Unknown first peer" */
plugin_log(cmd->plugin, LOG_DBG,
"sendonionmessage gave JSON error: %.*s",
json_tok_full_len(err), json_tok_full_len(err),
json_tok_full(buf, err)); json_tok_full(buf, err));
return command_hook_success(cmd); return command_hook_success(cmd);