MCPcopy Create free account
hub / github.com/ElementsProject/lightning / fetch_per_commitment_point

Function fetch_per_commitment_point

openingd/dualopend.c:4460–4479  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4458}
4459
4460static void fetch_per_commitment_point(u32 point_count,
4461 struct pubkey *commit_point)
4462{
4463 u8 *msg;
4464 struct secret *none;
4465
4466 wire_sync_write(HSM_FD,
4467 take(towire_hsmd_get_per_commitment_point(NULL, point_count)));
4468 msg = wire_sync_read(tmpctx, HSM_FD);
4469 if (!fromwire_hsmd_get_per_commitment_point_reply(tmpctx, msg,
4470 commit_point,
4471 &none))
4472 status_failed(STATUS_FAIL_HSM_IO,
4473 "Bad get_per_commitment_point_reply %s",
4474 tal_hex(tmpctx, msg));
4475
4476 /*~ The HSM gives us the N-2'th per-commitment secret when we get the
4477 * N'th per-commitment point. But since N=0, it won't give us one. */
4478 assert(none == NULL);
4479}
4480
4481int main(int argc, char *argv[])
4482{

Callers 1

mainFunction · 0.85

Calls 6

tal_hexFunction · 0.85
wire_sync_writeFunction · 0.50
wire_sync_readFunction · 0.50
status_failedFunction · 0.50

Tested by

no test coverage detected