mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-20 02:27:51 +01:00
29d6004efc
aka "BOLT 3: Use revocation key hash rather than revocation key", which builds on top of lightningnetwork/lightning-rfc#105 "BOLT 2,3,5: Make htlc outputs of the commitment tx spendable with revocation key". This affects callers, since they now need to hand us the revocation pubkey, but commit_tx has that already anyway. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
52 lines
1.9 KiB
C
52 lines
1.9 KiB
C
#ifndef LIGHTNING_LIGHTNINGD_HTLC_TX_H
|
|
#define LIGHTNING_LIGHTNINGD_HTLC_TX_H
|
|
#include "config.h"
|
|
#include <daemon/htlc.h>
|
|
|
|
struct preimage;
|
|
struct pubkey;
|
|
struct sha256_double;
|
|
|
|
/* Create HTLC-success tx to spend a received HTLC commitment tx
|
|
* output; doesn't fill in input witness. */
|
|
struct bitcoin_tx *htlc_success_tx(const tal_t *ctx,
|
|
const struct sha256_double *commit_txid,
|
|
unsigned int commit_output_number,
|
|
const struct htlc *received_htlc,
|
|
u16 to_self_delay,
|
|
const struct pubkey *revocation_pubkey,
|
|
const struct pubkey *local_delayedkey,
|
|
u64 feerate_per_kw);
|
|
|
|
/* Fill in the witness for HTLC-success tx produced above. */
|
|
void htlc_success_tx_add_witness(struct bitcoin_tx *htlc_success,
|
|
const struct abs_locktime *htlc_abstimeout,
|
|
const struct pubkey *localkey,
|
|
const struct pubkey *remotekey,
|
|
const secp256k1_ecdsa_signature *localsig,
|
|
const secp256k1_ecdsa_signature *remotesig,
|
|
const struct preimage *payment_preimage,
|
|
const struct pubkey *revocationkey);
|
|
|
|
/* Create HTLC-timeout tx to spend an offered HTLC commitment tx
|
|
* output; doesn't fill in input witness. */
|
|
struct bitcoin_tx *htlc_timeout_tx(const tal_t *ctx,
|
|
const struct sha256_double *commit_txid,
|
|
unsigned int commit_output_number,
|
|
const struct htlc *offered_htlc,
|
|
u16 to_self_delay,
|
|
const struct pubkey *revocation_pubkey,
|
|
const struct pubkey *local_delayedkey,
|
|
u64 feerate_per_kw);
|
|
|
|
/* Fill in the witness for HTLC-timeout tx produced above. */
|
|
void htlc_timeout_tx_add_witness(struct bitcoin_tx *htlc_timeout,
|
|
const struct pubkey *localkey,
|
|
const struct pubkey *remotekey,
|
|
const struct sha256 *payment_hash,
|
|
const struct pubkey *revocationkey,
|
|
const secp256k1_ecdsa_signature *localsig,
|
|
const secp256k1_ecdsa_signature *remotesig);
|
|
|
|
#endif /* LIGHTNING_LIGHTNINGD_HTLC_TX_H */
|