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
|
|
|
|
2023-10-02 00:59:49 +02:00
|
|
|
/* 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 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);
|
|
|
|
|
2023-07-21 09:19:22 +02:00
|
|
|
/* Tell channel about new feerates (owner must be channeld!) */
|
|
|
|
void channel_update_feerates(struct lightningd *ld, const struct channel *channel);
|
2023-10-02 00:59:49 +02:00
|
|
|
|
|
|
|
/* 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 00:59:51 +02:00
|
|
|
|
|
|
|
/* 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 00:59:52 +02:00
|
|
|
const struct bitcoin_txid *txid,
|
|
|
|
const struct bitcoin_outpoint *outpoint);
|
2018-02-20 21:59:09 +01:00
|
|
|
#endif /* LIGHTNING_LIGHTNINGD_CHANNEL_CONTROL_H */
|