2018-02-20 21:59:09 +01:00
|
|
|
#ifndef LIGHTNING_LIGHTNINGD_CONNECT_CONTROL_H
|
|
|
|
#define LIGHTNING_LIGHTNINGD_CONNECT_CONTROL_H
|
|
|
|
#include "config.h"
|
2022-03-22 21:30:59 +01:00
|
|
|
#include <ccan/short_types/short_types.h>
|
|
|
|
#include <ccan/tal/tal.h>
|
2018-02-20 21:59:09 +01:00
|
|
|
|
|
|
|
struct lightningd;
|
2022-03-22 21:30:59 +01:00
|
|
|
struct peer;
|
2018-02-20 21:59:09 +01:00
|
|
|
struct pubkey;
|
2018-08-09 02:25:29 +02:00
|
|
|
struct wireaddr_internal;
|
2018-02-20 21:59:09 +01:00
|
|
|
|
2018-07-24 08:18:58 +02:00
|
|
|
/* Returns fd for gossipd to talk to connectd */
|
2022-01-29 04:33:05 +01:00
|
|
|
int connectd_init(struct lightningd *ld);
|
2018-07-24 08:18:58 +02:00
|
|
|
void connectd_activate(struct lightningd *ld);
|
|
|
|
|
2022-03-22 21:30:59 +01:00
|
|
|
void try_reconnect(const tal_t *ctx,
|
|
|
|
struct peer *peer,
|
|
|
|
u32 seconds_delay,
|
|
|
|
const struct wireaddr_internal *addrhint);
|
2021-03-16 04:44:36 +01:00
|
|
|
void connect_succeeded(struct lightningd *ld, const struct peer *peer,
|
2021-03-25 04:53:31 +01:00
|
|
|
bool incoming,
|
2021-03-16 04:44:36 +01:00
|
|
|
const struct wireaddr_internal *addr);
|
2022-07-16 06:49:31 +02:00
|
|
|
void connect_failed_disconnect(struct lightningd *ld, const struct node_id *id);
|
2018-02-20 21:59:09 +01:00
|
|
|
|
2022-03-23 00:01:33 +01:00
|
|
|
/* Disconnect a peer (if no subds want to talk any more) */
|
|
|
|
void maybe_disconnect_peer(struct lightningd *ld, struct peer *peer);
|
|
|
|
|
2018-02-20 21:59:09 +01:00
|
|
|
#endif /* LIGHTNING_LIGHTNINGD_CONNECT_CONTROL_H */
|