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

Function make_revocation_msg

channeld/channeld.c:1673–1689  ·  view source on GitHub ↗

revoke_index == current index - 1 (usually; not for retransmission) */

Source from the content-addressed store, hash-verified

1671
1672/* revoke_index == current index - 1 (usually; not for retransmission) */
1673static u8 *make_revocation_msg(const struct peer *peer, u64 revoke_index,
1674 struct pubkey *point)
1675{
1676 struct secret old_commit_secret;
1677
1678 /* Now that the master has persisted the new commitment advance the HSMD
1679 * and fetch the revocation secret for the old one.
1680 *
1681 * After HSM_VERSION 5 we explicitly revoke the commitment in case
1682 * the original revoke didn't complete. The hsmd_revoke_commitment_tx
1683 * call is idempotent ...
1684 */
1685 revoke_commitment(revoke_index, &old_commit_secret, point);
1686
1687 return towire_revoke_and_ack(peer, &peer->channel_id, &old_commit_secret,
1688 point);
1689}
1690
1691/* Convert changed htlcs into parts which lightningd expects. */
1692static void marshall_htlc_info(const tal_t *ctx,

Callers 2

send_revocationFunction · 0.85
resend_revokeFunction · 0.85

Calls 1

revoke_commitmentFunction · 0.85

Tested by

no test coverage detected