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
|
|
|
|
2022-07-18 21:42:18 +09:30
|
|
|
bool 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
|
|
|
|
2023-10-02 09:29:49 +10:30
|
|
|
/* Send message to channeld (if connected) to tell it about depth
|
|
|
|
* c.f. dualopen_tell_depth! */
|
|
|
|
void channeld_tell_depth(struct channel *channel,
|
|
|
|
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
|
|
|
|
2022-09-10 11:40:31 +09:30
|
|
|
/* Update the channel info on channel_ready */
|
|
|
|
bool channel_on_channel_ready(struct channel *channel,
|
2024-01-31 13:46:17 +10:30
|
|
|
const struct pubkey *next_per_commitment_point,
|
|
|
|
const struct short_channel_id *remote_alias);
|
2020-11-23 19:25:54 -06:00
|
|
|
|
|
|
|
/* Record channel open (coin movement notifications) */
|
2022-07-19 14:35:56 -05:00
|
|
|
void channel_record_open(struct channel *channel, u32 blockheight, bool record_push);
|
2020-12-10 14:02:02 -06:00
|
|
|
|
|
|
|
/* A channel has unrecoverably fallen behind */
|
2024-06-19 09:30:01 +09:30
|
|
|
void channel_fallen_behind(struct channel *channel);
|
2022-01-25 06:32:52 +10:30
|
|
|
|
2023-07-21 16:49:22 +09:30
|
|
|
/* Tell channel about new feerates (owner must be channeld!) */
|
|
|
|
void channel_update_feerates(struct lightningd *ld, const struct channel *channel);
|
2023-10-02 09:29:49 +10:30
|
|
|
|
|
|
|
/* This channel is now locked in (the normal way, not zeroconf) */
|
|
|
|
void lockin_complete(struct channel *channel,
|
|
|
|
enum channel_state expected_state);
|
|
|
|
|
|
|
|
/* Accessor for zeroconf to tell us we've actually got an scid */
|
|
|
|
void lockin_has_completed(struct channel *channel, bool record_push);
|
2023-10-02 09:29:51 +10:30
|
|
|
|
|
|
|
/* Watch this incoming splice */
|
|
|
|
void watch_splice_inflight(struct lightningd *ld,
|
|
|
|
struct channel_inflight *inflight);
|
|
|
|
|
|
|
|
/* Update/set scid now this txid is mined. */
|
|
|
|
bool depthcb_update_scid(struct channel *channel,
|
2023-10-02 09:29:52 +10:30
|
|
|
const struct bitcoin_txid *txid,
|
|
|
|
const struct bitcoin_outpoint *outpoint);
|
2018-02-21 07:29:09 +10:30
|
|
|
#endif /* LIGHTNING_LIGHTNINGD_CHANNEL_CONTROL_H */
|