core-lightning/daemon/commit_tx.h
Rusty Russell 8a3c9908ce protocol: no signature in update_commit if receiver has no outputs.
So if there are no HTLCs, and the receiver can't spend anyway, don't
sign.  This has the added benefit that no two signed commitment
transactions will ever be identical (the revocation preimage changes).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-08-18 14:25:13 +09:30

40 lines
1.1 KiB
C

#ifndef LIGHTNING_COMMIT_TX_H
#define LIGHTNING_COMMIT_TX_H
#include "config.h"
#include "htlc.h"
struct channel_state;
struct sha256;
struct pubkey;
struct peer;
u8 *wscript_for_htlc(const tal_t *ctx,
const struct peer *peer,
const struct htlc *h,
const struct sha256 *rhash,
enum htlc_side side);
/* Returns scriptpubkey: *wscript is NULL if it's a direct p2wpkh. */
u8 *commit_output_to_us(const tal_t *ctx,
const struct peer *peer,
const struct sha256 *rhash,
enum htlc_side side,
u8 **wscript);
/* Returns scriptpubkey: *wscript is NULL if it's a direct p2wpkh. */
u8 *commit_output_to_them(const tal_t *ctx,
const struct peer *peer,
const struct sha256 *rhash,
enum htlc_side side,
u8 **wscript);
/* Create commitment tx to spend the anchor tx output; doesn't fill in
* input scriptsig. */
struct bitcoin_tx *create_commit_tx(const tal_t *ctx,
struct peer *peer,
const struct sha256 *rhash,
const struct channel_state *cstate,
enum htlc_side side,
bool *otherside_only);
#endif