From 695bec531cf57401973a0ef501bcfce2cecdabec Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 31 May 2019 11:31:22 +0930 Subject: [PATCH] plugin: fix printing of bad plugin responses. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before: Plugin for invoice_payment returned non-result response "subscriptions": [], "hooks": ["invoice_payment"]}} �V After: Plugin for invoice_payment returned non-result response {"jsonrpc": "2.0", "id": 6, "error": "Error while processing invoice_payment: ValueError(\"invalid literal for int() with base 10: '5.0'\")"} Signed-off-by: Rusty Russell --- lightningd/plugin_hook.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lightningd/plugin_hook.c b/lightningd/plugin_hook.c index 132ae3b91..54e7098ee 100644 --- a/lightningd/plugin_hook.c +++ b/lightningd/plugin_hook.c @@ -54,7 +54,7 @@ static void plugin_hook_callback(const char *buffer, const jsmntok_t *toks, if (!resulttok) fatal("Plugin for %s returned non-result response %.*s", r->hook->name, - toks->end - toks->start, buffer + toks->end); + toks->end - toks->start, buffer + toks->start); db_begin_transaction(r->db); r->hook->response_cb(r->cb_arg, buffer, resulttok);