2018-02-21 07:29:09 +10:30
|
|
|
#ifndef LIGHTNING_LIGHTNINGD_CONNECT_CONTROL_H
|
|
|
|
#define LIGHTNING_LIGHTNINGD_CONNECT_CONTROL_H
|
|
|
|
#include "config.h"
|
2022-03-23 07:00:59 +10:30
|
|
|
#include <ccan/short_types/short_types.h>
|
|
|
|
#include <ccan/tal/tal.h>
|
2022-07-23 11:21:31 -05:00
|
|
|
#include <common/utils.h>
|
2018-02-21 07:29:09 +10:30
|
|
|
|
|
|
|
struct lightningd;
|
2022-03-23 07:00:59 +10:30
|
|
|
struct peer;
|
2018-02-21 07:29:09 +10:30
|
|
|
struct pubkey;
|
2018-08-09 09:55:29 +09:30
|
|
|
struct wireaddr_internal;
|
2018-02-21 07:29:09 +10:30
|
|
|
|
2022-07-23 11:21:31 -05:00
|
|
|
/* Speedy reconnect timeout! */
|
|
|
|
#define DEV_FAST_RECONNECT(dev_fast_reconnect_flag, fast, normal) \
|
|
|
|
IFDEV((dev_fast_reconnect_flag) ? (fast) : (normal), (normal))
|
|
|
|
|
2018-07-24 15:48:58 +09:30
|
|
|
/* Returns fd for gossipd to talk to connectd */
|
2022-01-29 14:03:05 +10:30
|
|
|
int connectd_init(struct lightningd *ld);
|
2018-07-24 15:48:58 +09:30
|
|
|
void connectd_activate(struct lightningd *ld);
|
|
|
|
|
2022-03-23 07:00:59 +10:30
|
|
|
void try_reconnect(const tal_t *ctx,
|
|
|
|
struct peer *peer,
|
|
|
|
const struct wireaddr_internal *addrhint);
|
2021-03-16 14:14:36 +10:30
|
|
|
void connect_succeeded(struct lightningd *ld, const struct peer *peer,
|
2021-03-25 14:23:31 +10:30
|
|
|
bool incoming,
|
2021-03-16 14:14:36 +10:30
|
|
|
const struct wireaddr_internal *addr);
|
2022-07-18 21:42:28 +09:30
|
|
|
void connect_failed_disconnect(struct lightningd *ld,
|
|
|
|
const struct node_id *id,
|
|
|
|
const struct wireaddr_internal *addr);
|
2018-02-21 07:29:09 +10:30
|
|
|
|
2022-09-13 06:49:12 +09:30
|
|
|
/* Get the id of any connect cmd which applies, to feed to hooks */
|
|
|
|
const char *connect_any_cmd_id(const tal_t *ctx,
|
|
|
|
struct lightningd *ld, const struct peer *peer);
|
|
|
|
|
2018-02-21 07:29:09 +10:30
|
|
|
#endif /* LIGHTNING_LIGHTNINGD_CONNECT_CONTROL_H */
|