| 303 | } |
| 304 | |
| 305 | const u8 *hsm_sync_req(const tal_t *ctx, struct lightningd *ld, const u8 *msg) |
| 306 | { |
| 307 | int type = fromwire_peektype(msg); |
| 308 | if (!wire_sync_write(ld->hsm_fd, msg)) |
| 309 | fatal("Writing %s hsm", hsmd_wire_name(type)); |
| 310 | msg = wire_sync_read(ctx, ld->hsm_fd); |
| 311 | if (!msg) |
| 312 | fatal("EOF reading from HSM after %s", |
| 313 | hsmd_wire_name(type)); |
| 314 | return msg; |
| 315 | } |
| 316 | |
| 317 | static struct command_result *json_makesecret(struct command *cmd, |
| 318 | const char *buffer, |
no test coverage detected