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

Function get_per_commitment_point

channeld/channeld.c:1420–1444  ·  view source on GitHub ↗

If old_secret is NULL, we don't care, otherwise it is filled in. */

Source from the content-addressed store, hash-verified

1418
1419/* If old_secret is NULL, we don't care, otherwise it is filled in. */
1420static void get_per_commitment_point(u64 index, struct pubkey *point,
1421 struct secret *old_secret)
1422{
1423 struct secret *s;
1424 const u8 *msg;
1425
1426 msg = hsm_req(tmpctx,
1427 take(towire_hsmd_get_per_commitment_point(NULL, index)));
1428
1429 if (!fromwire_hsmd_get_per_commitment_point_reply(tmpctx, msg,
1430 point,
1431 &s))
1432 status_failed(STATUS_FAIL_HSM_IO,
1433 "Bad per_commitment_point reply %s",
1434 tal_hex(tmpctx, msg));
1435
1436 if (old_secret) {
1437 if (!s)
1438 status_failed(STATUS_FAIL_HSM_IO,
1439 "No secret in per_commitment_point_reply %"
1440 PRIu64,
1441 index);
1442 *old_secret = *s;
1443 }
1444}
1445
1446/* revoke_index == current index - 1 (usually; not for retransmission) */
1447static u8 *make_revocation_msg(const struct peer *peer, u64 revoke_index,

Callers 5

make_revocation_msgFunction · 0.85
peer_reconnectFunction · 0.85
handle_funding_depthFunction · 0.85
init_channelFunction · 0.85

Calls 5

hsm_reqFunction · 0.85
tal_hexFunction · 0.85
status_failedFunction · 0.50

Tested by

no test coverage detected