2018-02-21 07:29:09 +10:30
|
|
|
#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 19:38:01 +09:30
|
|
|
struct lightningd;
|
2022-01-11 11:43:59 +10:30
|
|
|
struct peer_fd;
|
2020-08-28 13:26:32 +09:30
|
|
|
struct peer;
|
2018-02-21 07:29:09 +10:30
|
|
|
|
2018-08-09 09:56:30 +09:30
|
|
|
void peer_start_channeld(struct channel *channel,
|
2022-01-11 11:43:59 +10:30
|
|
|
struct peer_fd *peer_fd,
|
2020-09-10 14:34:18 -05:00
|
|
|
const u8 *fwd_msg,
|
2021-06-15 14:37:10 +09:30
|
|
|
bool reconnected,
|
2022-03-23 06:57:30 +10:30
|
|
|
bool reestablish_only);
|
2018-02-21 07:29:09 +10:30
|
|
|
|
2018-04-23 19:38:01 +09:30
|
|
|
/* Returns true if subd told, otherwise false. */
|
2019-02-27 00:57:19 +08:00
|
|
|
bool channel_tell_depth(struct lightningd *ld,
|
2018-04-23 19:38:01 +09:30
|
|
|
struct channel *channel,
|
2018-05-17 14:38:11 +09:30
|
|
|
const struct bitcoin_txid *txid,
|
|
|
|
u32 depth);
|
2018-05-06 13:32:01 +00:00
|
|
|
/* Notify channels of new blocks. */
|
|
|
|
void channel_notify_new_block(struct lightningd *ld,
|
|
|
|
u32 block_height);
|
2018-04-23 19:38:01 +09:30
|
|
|
|
2019-08-24 05:34:52 +08: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 12:34:26 +08:00
|
|
|
struct peer *peer);
|
2019-08-24 05:34:52 +08:00
|
|
|
|
2020-11-23 19:24:50 -06:00
|
|
|
/* Update the channel info on funding locked */
|
|
|
|
bool channel_on_funding_locked(struct channel *channel,
|
|
|
|
struct pubkey *next_per_commitment_point);
|
2020-11-23 19:25:54 -06:00
|
|
|
|
|
|
|
/* Record channel open (coin movement notifications) */
|
|
|
|
void channel_record_open(struct channel *channel);
|
2020-12-10 14:02:02 -06:00
|
|
|
|
|
|
|
/* A channel has unrecoverably fallen behind */
|
|
|
|
void channel_fallen_behind(struct channel *channel, const u8 *msg);
|
2022-01-25 06:32:52 +10:30
|
|
|
|
|
|
|
/* Fresh channel_update for this channel. */
|
|
|
|
void channel_replace_update(struct channel *channel, u8 *update TAKES);
|
|
|
|
|
2018-02-21 07:29:09 +10:30
|
|
|
#endif /* LIGHTNING_LIGHTNINGD_CHANNEL_CONTROL_H */
|