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

Function revoke_commitment

channeld/channeld.c:1659–1670  ·  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

1657 * to revoke a commitment beyond the next revocable commitment.
1658 */
1659static void revoke_commitment(u64 index, struct secret *old_secret, struct pubkey *point)
1660{
1661 const u8 *msg;
1662
1663 msg = hsm_req(tmpctx,
1664 take(towire_hsmd_revoke_commitment_tx(tmpctx, index)));
1665
1666 if (!fromwire_hsmd_revoke_commitment_tx_reply(msg, old_secret, point))
1667 status_failed(STATUS_FAIL_HSM_IO,
1668 "Reading revoke_commitment_tx reply: %s",
1669 tal_hex(tmpctx, msg));
1670}
1671
1672/* revoke_index == current index - 1 (usually; not for retransmission) */
1673static 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