| 98 | } |
| 99 | |
| 100 | void get_channel_basepoints(struct lightningd *ld, |
| 101 | const struct node_id *peer_id, |
| 102 | const u64 dbid, |
| 103 | struct basepoints *local_basepoints, |
| 104 | struct pubkey *local_funding_pubkey) |
| 105 | { |
| 106 | u8 *msg; |
| 107 | |
| 108 | assert(dbid != 0); |
| 109 | msg = towire_hsmd_get_channel_basepoints(NULL, peer_id, dbid); |
| 110 | if (!wire_sync_write(ld->hsm_fd, take(msg))) |
| 111 | fatal("Could not write to HSM: %s", strerror(errno)); |
| 112 | |
| 113 | msg = wire_sync_read(tmpctx, ld->hsm_fd); |
| 114 | if (!fromwire_hsmd_get_channel_basepoints_reply(msg, local_basepoints, |
| 115 | local_funding_pubkey)) |
| 116 | fatal("HSM gave bad hsm_get_channel_basepoints_reply %s", |
| 117 | tal_hex(msg, msg)); |
| 118 | } |
| 119 | |
| 120 | static void destroy_inflight(struct channel_inflight *inflight) |
| 121 | { |
no test coverage detected