2018-02-20 21:59:09 +01:00
|
|
|
#ifndef LIGHTNING_LIGHTNINGD_CHANNEL_CONTROL_H
|
|
|
|
#define LIGHTNING_LIGHTNINGD_CHANNEL_CONTROL_H
|
|
|
|
#include "config.h"
|
|
|
|
#include <ccan/short_types/short_types.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
|
|
|
struct channel;
|
|
|
|
struct crypto_state;
|
2018-04-23 12:08:01 +02:00
|
|
|
struct lightningd;
|
2022-01-11 02:13:59 +01:00
|
|
|
struct peer_fd;
|
2020-08-28 05:56:32 +02:00
|
|
|
struct peer;
|
2018-02-20 21:59:09 +01:00
|
|
|
|
2022-07-18 14:12:18 +02:00
|
|
|
bool peer_start_channeld(struct channel *channel,
|
2022-01-11 02:13:59 +01:00
|
|
|
struct peer_fd *peer_fd,
|
2020-09-10 21:34:18 +02:00
|
|
|
const u8 *fwd_msg,
|
2021-06-15 07:07:10 +02:00
|
|
|
bool reconnected,
|
2022-03-22 21:27:30 +01:00
|
|
|
bool reestablish_only);
|
2018-02-20 21:59:09 +01:00
|
|
|
|
2018-04-23 12:08:01 +02:00
|
|
|
/* Returns true if subd told, otherwise false. */
|
2019-02-26 17:57:19 +01:00
|
|
|
bool channel_tell_depth(struct lightningd *ld,
|
2018-04-23 12:08:01 +02:00
|
|
|
struct channel *channel,
|
2018-05-17 07:08:11 +02:00
|
|
|
const struct bitcoin_txid *txid,
|
|
|
|
u32 depth);
|
2018-05-06 15:32:01 +02:00
|
|
|
/* Notify channels of new blocks. */
|
|
|
|
void channel_notify_new_block(struct lightningd *ld,
|
|
|
|
u32 block_height);
|
2018-04-23 12:08:01 +02:00
|
|
|
|
2019-08-23 23:34:52 +02:00
|
|
|
/* Cancel the channel after `fundchannel_complete` succeeds
|
|
|
|
* but before funding broadcasts. */
|
|
|
|
struct command_result *cancel_channel_before_broadcast(struct command *cmd,
|
2020-06-24 06:34:26 +02:00
|
|
|
struct peer *peer);
|
2019-08-23 23:34:52 +02:00
|
|
|
|
2022-09-10 04:10:31 +02:00
|
|
|
/* Update the channel info on channel_ready */
|
|
|
|
bool channel_on_channel_ready(struct channel *channel,
|
|
|
|
struct pubkey *next_per_commitment_point);
|
2020-11-24 02:25:54 +01:00
|
|
|
|
|
|
|
/* Record channel open (coin movement notifications) */
|
2022-07-19 21:35:56 +02:00
|
|
|
void channel_record_open(struct channel *channel, u32 blockheight, bool record_push);
|
2020-12-10 21:02:02 +01:00
|
|
|
|
|
|
|
/* A channel has unrecoverably fallen behind */
|
|
|
|
void channel_fallen_behind(struct channel *channel, const u8 *msg);
|
2022-01-24 21:02:52 +01:00
|
|
|
|
|
|
|
/* Fresh channel_update for this channel. */
|
|
|
|
void channel_replace_update(struct channel *channel, u8 *update TAKES);
|
|
|
|
|
2018-02-20 21:59:09 +01:00
|
|
|
#endif /* LIGHTNING_LIGHTNINGD_CHANNEL_CONTROL_H */
|