mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-20 10:39:49 +01:00
d8af789bbb
We had enum channel_side (OURS, THEIRS) for which end of a channel we had, and htlc_side (LOCAL, REMOTE) for who proposed the HTLC. Combine these both into simply "enum side". Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
40 lines
1.0 KiB
C
40 lines
1.0 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 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 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 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 side side,
|
|
bool *otherside_only);
|
|
#endif
|