mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 07:04:22 +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:
@@ -315,7 +315,7 @@ u8 *cryptomsg_encrypt_msg(const tal_t *ctx,
|
||||
tal_hexstr(trc, msg, mlen),
|
||||
tal_hexstr(trc, npub, sizeof(npub)),
|
||||
tal_hexstr(trc, &cs->sk, sizeof(cs->sk)),
|
||||
tal_hexstr(trc, out + 18, clen));
|
||||
tal_hexstr(trc, out + CRYPTOMSG_HDR_SIZE, clen));
|
||||
#endif
|
||||
|
||||
maybe_rotate_key(&cs->sn, &cs->sk, &cs->s_ck);
|
||||
|
||||
Reference in New Issue
Block a user