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

Function revoke_commitment

channeld/channeld.c:1589–1600  ·  view source on GitHub ↗

Revoke the specified commitment, the old secret is returned and * next commitment point are returned. This call is idempotent, it is * fine to re-revoke a previously revoked commitment. It is an error * to revoke a commitment beyond the next revocable commitment. */

Source from the content-addressed store, hash-verified

1587 * to revoke a commitment beyond the next revocable commitment.
1588 */
1589static void revoke_commitment(u64 index, struct secret *old_secret, struct pubkey *point)
1590{
1591 const u8 *msg;
1592
1593 msg = hsm_req(tmpctx,
1594 take(towire_hsmd_revoke_commitment_tx(tmpctx, index)));
1595
1596 if (!fromwire_hsmd_revoke_commitment_tx_reply(msg, old_secret, point))
1597 status_failed(STATUS_FAIL_HSM_IO,
1598 "Reading revoke_commitment_tx reply: %s",
1599 tal_hex(tmpctx, msg));
1600}
1601
1602/* revoke_index == current index - 1 (usually; not for retransmission) */
1603static u8 *make_revocation_msg(const struct peer *peer, u64 revoke_index,

Callers 2

make_revocation_msgFunction · 0.85

Calls 3

hsm_reqFunction · 0.85
tal_hexFunction · 0.85
status_failedFunction · 0.50

Tested by

no test coverage detected