mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
connectd/peer_exchange_initmsg: handle peer comms ourselves.
connectd is the only user of the cryptomsg async APIs; better to open-code it here. We need to expose a little from cryptomsg(), but we remove the 'struct peer' entirely from connectd. One trick is that we still need to defer telling lightningd when a peer reconnects (until it tells us the old one is disconnected). So now we generate the message for lightningd and send it once we're woken. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
18
connectd/peer_exchange_initmsg.h
Normal file
18
connectd/peer_exchange_initmsg.h
Normal file
@@ -0,0 +1,18 @@
|
||||
#ifndef LIGHTNING_CONNECTD_PEER_EXCHANGE_INITMSG_H
|
||||
#define LIGHTNING_CONNECTD_PEER_EXCHANGE_INITMSG_H
|
||||
#include "config.h"
|
||||
|
||||
struct crypto_state;
|
||||
struct daemon;
|
||||
struct io_conn;
|
||||
struct pubkey;
|
||||
struct wireaddr_internal;
|
||||
|
||||
/* If successful, calls peer_connected() */
|
||||
struct io_plan *peer_exchange_initmsg(struct io_conn *conn,
|
||||
struct daemon *daemon,
|
||||
const struct crypto_state *cs,
|
||||
const struct pubkey *id,
|
||||
const struct wireaddr_internal *addr);
|
||||
|
||||
#endif /* LIGHTNING_CONNECTD_PEER_EXCHANGE_INITMSG_H */
|
||||
Reference in New Issue
Block a user