forked from ElementsProject/lightning
-
Notifications
You must be signed in to change notification settings - Fork 0
/
connect_control.h
36 lines (30 loc) · 1.23 KB
/
connect_control.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef LIGHTNING_LIGHTNINGD_CONNECT_CONTROL_H
#define LIGHTNING_LIGHTNINGD_CONNECT_CONTROL_H
#include "config.h"
#include <ccan/short_types/short_types.h>
#include <ccan/tal/tal.h>
#include <common/utils.h>
struct lightningd;
struct peer;
struct pubkey;
struct wireaddr_internal;
/* Speedy reconnect timeout! */
#define DEV_FAST_RECONNECT(dev_fast_reconnect_flag, fast, normal) \
IFDEV((dev_fast_reconnect_flag) ? (fast) : (normal), (normal))
/* Returns fd for gossipd to talk to connectd */
int connectd_init(struct lightningd *ld);
void connectd_activate(struct lightningd *ld);
void connectd_start_shutdown(struct subd *connectd);
void try_reconnect(const tal_t *ctx,
struct peer *peer,
const struct wireaddr_internal *addrhint);
void connect_succeeded(struct lightningd *ld, const struct peer *peer,
bool incoming,
const struct wireaddr_internal *addr);
void connect_failed_disconnect(struct lightningd *ld,
const struct node_id *id,
const struct wireaddr_internal *addr);
/* 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);
#endif /* LIGHTNING_LIGHTNINGD_CONNECT_CONTROL_H */