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

Function steal_htlc

onchaind/onchaind.c:2981–3000  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2979}
2980
2981static void steal_htlc(struct tracked_output *out)
2982{
2983 struct bitcoin_tx *tx;
2984 enum tx_type tx_type = OUR_PENALTY_TX;
2985 u8 der[PUBKEY_CMPR_LEN];
2986
2987 /* BOLT #3:
2988 *
2989 * If a revoked commitment transaction is published, the remote node can
2990 * spend this output immediately with the following witness:
2991 *
2992 * <revocation_sig> <revocationpubkey>
2993 */
2994 pubkey_to_der(der, &keyset->self_revocation_key);
2995 tx = tx_to_us(out, penalty_to_us, out, BITCOIN_TX_RBF_SEQUENCE, 0,
2996 der, sizeof(der), out->wscript, &tx_type,
2997 penalty_feerate);
2998
2999 propose_resolution(out, tx, 0, tx_type);
3000}
3001
3002/* Tell wallet that we have discovered a UTXO from a to-remote output,
3003 * which it can spend with a little additional info we give here. */

Callers 1

handle_their_cheatFunction · 0.85

Calls 3

tx_to_usFunction · 0.85
propose_resolutionFunction · 0.85
pubkey_to_derFunction · 0.50

Tested by

no test coverage detected