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-06-30 01:38:10 +02:00
|
|
|
#include "daemon/channel.h"
|
2016-08-18 06:53:45 +02:00
|
|
|
#include "daemon/htlc.h"
|
2015-05-30 13:14:00 +02:00
|
|
|
|
2015-08-07 05:15:30 +02:00
|
|
|
struct channel_state;
|
2015-05-30 13:14:00 +02:00
|
|
|
struct sha256_double;
|
2016-01-21 21:14:27 +01:00
|
|
|
struct sha256;
|
2016-01-21 21:11:47 +01:00
|
|
|
struct pubkey;
|
|
|
|
struct rel_locktime;
|
2015-05-30 13:14:00 +02:00
|
|
|
|
2016-08-18 06:53:45 +02:00
|
|
|
u8 *wscript_for_htlc(const tal_t *ctx,
|
|
|
|
secp256k1_context *secpctx,
|
|
|
|
const struct htlc *h,
|
|
|
|
const struct pubkey *our_final,
|
|
|
|
const struct pubkey *their_final,
|
|
|
|
const struct rel_locktime *our_locktime,
|
|
|
|
const struct rel_locktime *their_locktime,
|
|
|
|
const struct sha256 *rhash,
|
|
|
|
enum htlc_side side);
|
|
|
|
|
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-07-01 03:49:28 +02:00
|
|
|
secp256k1_context *secpctx,
|
2016-01-21 21:11:47 +01:00
|
|
|
const struct pubkey *our_final,
|
|
|
|
const struct pubkey *their_final,
|
2016-05-26 07:55:24 +02:00
|
|
|
const struct rel_locktime *our_locktime,
|
2016-01-21 21:11:47 +01:00
|
|
|
const struct rel_locktime *their_locktime,
|
|
|
|
const struct sha256_double *anchor_txid,
|
|
|
|
unsigned int anchor_index,
|
|
|
|
u64 anchor_satoshis,
|
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-05-26 07:55:24 +02:00
|
|
|
enum channel_side side,
|
2016-05-02 08:35:56 +02:00
|
|
|
int **map);
|
2015-05-30 13:14:00 +02:00
|
|
|
#endif
|