2015-05-30 20:44:00 +09:30
|
|
|
#ifndef LIGHTNING_COMMIT_TX_H
|
|
|
|
#define LIGHTNING_COMMIT_TX_H
|
2016-01-22 06:38:08 +10:30
|
|
|
#include "config.h"
|
2016-08-18 14:23:45 +09:30
|
|
|
#include "htlc.h"
|
2015-05-30 20:44:00 +09:30
|
|
|
|
2015-08-07 12:45:30 +09:30
|
|
|
struct channel_state;
|
2016-01-22 06:44:27 +10:30
|
|
|
struct sha256;
|
2016-01-22 06:41:47 +10:30
|
|
|
struct pubkey;
|
2016-08-18 14:23:45 +09:30
|
|
|
struct peer;
|
2015-05-30 20:44:00 +09:30
|
|
|
|
2016-08-18 14:23:45 +09:30
|
|
|
u8 *wscript_for_htlc(const tal_t *ctx,
|
2016-08-18 14:23:45 +09:30
|
|
|
const struct peer *peer,
|
2016-08-18 14:23:45 +09:30
|
|
|
const struct htlc *h,
|
|
|
|
const struct sha256 *rhash,
|
2016-08-31 16:06:32 +09:30
|
|
|
enum side side);
|
2016-08-18 14:23:45 +09:30
|
|
|
|
2016-08-18 14:23:45 +09:30
|
|
|
/* 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 16:06:32 +09:30
|
|
|
enum side side,
|
2016-08-18 14:23:45 +09:30
|
|
|
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 16:06:32 +09:30
|
|
|
enum side side,
|
2016-08-18 14:23:45 +09:30
|
|
|
u8 **wscript);
|
|
|
|
|
2015-05-30 20:44:00 +09:30
|
|
|
/* 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 14:23:45 +09:30
|
|
|
struct peer *peer,
|
2015-07-29 16:14:28 +09:30
|
|
|
const struct sha256 *rhash,
|
2016-05-02 16:05:56 +09:30
|
|
|
const struct channel_state *cstate,
|
2016-08-31 16:06:32 +09:30
|
|
|
enum side side,
|
2016-08-18 14:25:13 +09:30
|
|
|
bool *otherside_only);
|
2015-05-30 20:44:00 +09:30
|
|
|
#endif
|