Browse Source

bcli: only print error if exitcode is non-zero

ppa
niftynei 4 years ago
committed by Christian Decker
parent
commit
47d9ff88df
  1. 6
      plugins/bcli.c

6
plugins/bcli.c

@ -601,8 +601,10 @@ static struct command_result *process_sendrawtransaction(struct bitcoin_cli *bcl
response = jsonrpc_stream_success(bcli->cmd); response = jsonrpc_stream_success(bcli->cmd);
json_add_bool(response, "success", *bcli->exitstatus == 0); json_add_bool(response, "success", *bcli->exitstatus == 0);
json_add_string(response, "errmsg", json_add_string(response, "errmsg",
bcli->exitstatus ? tal_strndup(bcli->cmd, bcli->output, *bcli->exitstatus ?
bcli->output_bytes-1) : ""); tal_strndup(bcli->cmd,
bcli->output, bcli->output_bytes-1)
: "");
return command_finished(bcli->cmd, response); return command_finished(bcli->cmd, response);
} }

Loading…
Cancel
Save