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. */
| 1587 | * to revoke a commitment beyond the next revocable commitment. |
| 1588 | */ |
| 1589 | static 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) */ |
| 1603 | static u8 *make_revocation_msg(const struct peer *peer, u64 revoke_index, |
no test coverage detected