| 524 | } |
| 525 | |
| 526 | static struct command_result *process_sendrawtransaction(struct bitcoin_cli *bcli) |
| 527 | { |
| 528 | struct json_stream *response; |
| 529 | |
| 530 | /* This is useful for functional tests. */ |
| 531 | if (bcli->exitstatus) |
| 532 | plugin_log(bcli->cmd->plugin, LOG_DBG, |
| 533 | "sendrawtx exit %i (%s) %.*s", |
| 534 | *bcli->exitstatus, bcli_args(bcli), |
| 535 | *bcli->exitstatus ? |
| 536 | (u32)bcli->output_bytes-1 : 0, |
| 537 | bcli->output); |
| 538 | |
| 539 | response = jsonrpc_stream_success(bcli->cmd); |
| 540 | json_add_bool(response, "success", |
| 541 | *bcli->exitstatus == 0 || |
| 542 | *bcli->exitstatus == |
| 543 | RPC_TRANSACTION_ALREADY_IN_CHAIN); |
| 544 | json_add_string(response, "errmsg", |
| 545 | *bcli->exitstatus ? |
| 546 | tal_strndup(bcli->cmd, |
| 547 | bcli->output, bcli->output_bytes-1) |
| 548 | : ""); |
| 549 | |
| 550 | return command_finished(bcli->cmd, response); |
| 551 | } |
| 552 | |
| 553 | struct getrawblock_stash { |
| 554 | const char *block_hash; |
nothing calls this directly
no test coverage detected