2015-05-30 13:14:00 +02:00
|
|
|
#ifndef LIGHTNING_COMMIT_TX_H
|
|
|
|
#define LIGHTNING_COMMIT_TX_H
|
2016-01-21 21:08:08 +01:00
|
|
|
#include "config.h"
|
2016-08-18 06:53:45 +02:00
|
|
|
#include "htlc.h"
|
2017-02-02 05:05:45 +01:00
|
|
|
#include <ccan/tal/tal.h>
|
2015-05-30 13:14:00 +02:00
|
|
|
|
2015-08-07 05:15:30 +02:00
|
|
|
struct channel_state;
|
2016-01-21 21:14:27 +01:00
|
|
|
struct sha256;
|
2016-01-21 21:11:47 +01:00
|
|
|
struct pubkey;
|
2016-08-18 06:53:45 +02:00
|
|
|
struct peer;
|
2015-05-30 13:14:00 +02:00
|
|
|
|
2016-08-18 06:53:45 +02:00
|
|
|
u8 *wscript_for_htlc(const tal_t *ctx,
|
2016-08-18 06:53:45 +02:00
|
|
|
const struct peer *peer,
|
2016-08-18 06:53:45 +02:00
|
|
|
const struct htlc *h,
|
|
|
|
const struct sha256 *rhash,
|
2016-08-31 08:36:32 +02:00
|
|
|
enum side side);
|
2016-08-18 06:53:45 +02:00
|
|
|
|
2016-08-18 06:53:45 +02:00
|
|
|
/* 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,
|
2016-08-31 08:36:32 +02:00
|
|
|
enum side side,
|
2016-08-18 06:53:45 +02:00
|
|
|
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,
|
2016-08-31 08:36:32 +02:00
|
|
|
enum side side,
|
2016-08-18 06:53:45 +02:00
|
|
|
u8 **wscript);
|
|
|
|
|
2015-05-30 13:14:00 +02:00
|
|
|
/* 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,
|
2016-08-18 06:53:45 +02:00
|
|
|
struct peer *peer,
|
2015-07-29 08:44:28 +02:00
|
|
|
const struct sha256 *rhash,
|
2016-05-02 08:35:56 +02:00
|
|
|
const struct channel_state *cstate,
|
2016-08-31 08:36:32 +02:00
|
|
|
enum side side,
|
2016-08-18 06:55:13 +02:00
|
|
|
bool *otherside_only);
|
2015-05-30 13:14:00 +02:00
|
|
|
#endif
|