bookkeeper: fix printing of bad JSON results.

I noticed this in the logs:

```
listinvoices: description/bolt11/bolt12 not found (

{"jsonrpc":"2)
```

And we make the same formatting mistake in several places.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2025-11-20 10:34:50 +10:30
parent 55d622bd0e
commit ef5a9bd0de

View File

@@ -238,12 +238,12 @@ getblockheight_done(struct command *cmd,
if (!blockheight_tok)
plugin_err(cmd->plugin, "getblockheight: "
"getinfo gave no 'blockheight'? '%.*s'",
result->end - result->start, buf);
result->end - result->start, buf + result->start);
if (!json_to_u32(buf, blockheight_tok, &blockheight))
plugin_err(cmd->plugin, "getblockheight: "
"getinfo gave non-unsigned-32-bit 'blockheight'? '%.*s'",
result->end - result->start, buf);
result->end - result->start, buf + result->start);
/* Get the income events */
apys = compute_channel_apys(cmd, bkpr, cmd,
@@ -1013,7 +1013,7 @@ listinvoices_done(struct command *cmd,
"listinvoices:"
" description/bolt11/bolt12"
" not found (%.*s)",
result->end - result->start, buf);
result->end - result->start, buf + result->start);
return rinfo_one_done(cmd, phinfo->rinfo);
}
@@ -1053,7 +1053,7 @@ listsendpays_done(struct command *cmd,
plugin_log(cmd->plugin, LOG_DBG,
"listpays: bolt11/bolt12 not found:"
"(%.*s)",
result->end - result->start, buf);
result->end - result->start, buf + result->start);
return rinfo_one_done(cmd, phinfo->rinfo);
}