forked from ElementsProject/lightning
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]>
- Loading branch information
1 parent
cfd54d6
commit a1bdaa8
Showing
7 changed files
with
289 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,22 @@ | ||
#ifndef LIGHTNING_CONNECTD_CONNECTD_H | ||
#define LIGHTNING_CONNECTD_CONNECTD_H | ||
#include "config.h" | ||
#include <bitcoin/pubkey.h> | ||
#include <common/crypto_state.h> | ||
|
||
struct io_conn; | ||
struct peer; | ||
struct reaching; | ||
struct daemon; | ||
|
||
/* Called by io_tor_connect once it has a connection out. */ | ||
struct io_plan *connection_out(struct io_conn *conn, struct reaching *reach); | ||
|
||
/* Called by peer_exchange_initmsg if successful. */ | ||
struct io_plan *peer_connected(struct io_conn *conn, | ||
struct daemon *daemon, | ||
const struct pubkey *id TAKES, | ||
const u8 *peer_connected_msg TAKES, | ||
const u8 *lfeatures TAKES); | ||
|
||
#endif /* LIGHTNING_CONNECTD_CONNECTD_H */ |
Oops, something went wrong.