From 47d9ff88df3d58c7258ad2daa7aab0ec331ea6ee Mon Sep 17 00:00:00 2001 From: niftynei Date: Wed, 9 Dec 2020 13:06:30 -0600 Subject: [PATCH] bcli: only print error if exitcode is non-zero --- plugins/bcli.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/bcli.c b/plugins/bcli.c index 49665eb65..43cb58679 100644 --- a/plugins/bcli.c +++ b/plugins/bcli.c @@ -601,8 +601,10 @@ static struct command_result *process_sendrawtransaction(struct bitcoin_cli *bcl response = jsonrpc_stream_success(bcli->cmd); json_add_bool(response, "success", *bcli->exitstatus == 0); json_add_string(response, "errmsg", - bcli->exitstatus ? tal_strndup(bcli->cmd, bcli->output, - bcli->output_bytes-1) : ""); + *bcli->exitstatus ? + tal_strndup(bcli->cmd, + bcli->output, bcli->output_bytes-1) + : ""); return command_finished(bcli->cmd, response); }