2018-02-20 21:59:04 +01:00
|
|
|
#ifndef LIGHTNING_LIGHTNINGD_OPENING_CONTROL_H
|
|
|
|
#define LIGHTNING_LIGHTNINGD_OPENING_CONTROL_H
|
|
|
|
#include "config.h"
|
|
|
|
#include <ccan/short_types/short_types.h>
|
|
|
|
|
|
|
|
struct channel_id;
|
|
|
|
struct crypto_state;
|
|
|
|
struct json_result;
|
|
|
|
struct lightningd;
|
|
|
|
struct pubkey;
|
|
|
|
struct uncommitted_channel;
|
|
|
|
struct wireaddr;
|
|
|
|
|
|
|
|
void json_add_uncommitted_channel(struct json_result *response,
|
|
|
|
const struct uncommitted_channel *uc);
|
|
|
|
|
|
|
|
/* Peer has spontaneously exited from gossip due to open msg. Return
|
|
|
|
* NULL if we took over, otherwise hand back to gossipd with this
|
2018-03-19 10:27:09 +01:00
|
|
|
* error (allocated off @ctx).
|
2018-02-20 21:59:04 +01:00
|
|
|
*/
|
2018-03-19 10:27:09 +01:00
|
|
|
u8 *peer_accept_channel(const tal_t *ctx,
|
|
|
|
struct lightningd *ld,
|
2018-02-20 21:59:04 +01:00
|
|
|
const struct pubkey *peer_id,
|
|
|
|
const struct wireaddr *addr,
|
|
|
|
const struct crypto_state *cs,
|
|
|
|
u64 gossip_index,
|
|
|
|
const u8 *gfeatures, const u8 *lfeatures,
|
|
|
|
int peer_fd, int gossip_fd,
|
|
|
|
const struct channel_id *channel_id,
|
|
|
|
const u8 *open_msg);
|
|
|
|
|
2018-04-23 12:08:01 +02:00
|
|
|
/* Gossipd spat out peer: were we currently asking gossipd to release it
|
|
|
|
* so we could open a channel? Returns true if it took over. */
|
|
|
|
bool handle_opening_channel(struct lightningd *ld,
|
|
|
|
const struct pubkey *id,
|
|
|
|
const struct wireaddr *addr,
|
|
|
|
const struct crypto_state *cs,
|
|
|
|
u64 gossip_index,
|
|
|
|
const u8 *gfeatures, const u8 *lfeatures,
|
|
|
|
int peer_fd, int gossip_fd);
|
2018-02-20 21:59:04 +01:00
|
|
|
|
|
|
|
void kill_uncommitted_channel(struct uncommitted_channel *uc,
|
|
|
|
const char *why);
|
|
|
|
#endif /* LIGHTNING_LIGHTNINGD_OPENING_CONTROL_H */
|