mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 07:34:24 +01:00
We currently create a peer struct, then complete handshake to find out who it is. This means we have a half-formed peer, and worse: if it's a reconnect we get two peers the same. Add an explicit 'struct connection' for the handshake phase, and construct a 'struct peer' once that's done. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
24 lines
631 B
C
24 lines
631 B
C
#ifndef LIGHTNING_LIGHTNINGD_NEW_CONNECTION_H
|
|
#define LIGHTNING_LIGHTNINGD_NEW_CONNECTION_H
|
|
#include "config.h"
|
|
#include <stdbool.h>
|
|
|
|
struct command;
|
|
struct io_conn;
|
|
struct lightningd;
|
|
struct lightningd_state;
|
|
struct pubkey;
|
|
|
|
struct connection *new_connection(const tal_t *ctx,
|
|
struct lightningd *ld,
|
|
struct command *cmd,
|
|
const struct pubkey *known_id);
|
|
|
|
struct io_plan *connection_out(struct io_conn *conn,
|
|
struct lightningd_state *dstate,
|
|
struct connection *c);
|
|
|
|
struct io_plan *connection_in(struct io_conn *conn, struct lightningd *ld);
|
|
|
|
#endif /* LIGHTNING_LIGHTNINGD_NEW_CONNECTION_H */
|