Files
lightning/common/peer_io.h
Rusty Russell ce8b69401c peer_io: replace crypto_sync in daemons, use normal wire messages.
Now connectd is doing the crypto, we can use normal wire io.  We
create helper functions to clearly differentiate between "peer" comms
and intra-daemon comms though.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-01-20 15:24:06 +10:30

19 lines
613 B
C

#ifndef LIGHTNING_COMMON_PEER_IO_H
#define LIGHTNING_COMMON_PEER_IO_H
#include "config.h"
#include <ccan/short_types/short_types.h>
#include <ccan/tal/tal.h>
struct per_peer_state;
/* Exits with peer_failed_connection_lost() if write fails. */
void peer_write(struct per_peer_state *pps, const void *msg TAKES);
/* Same, but disabled nagle for this message. */
void peer_write_no_delay(struct per_peer_state *pps, const void *msg TAKES);
/* Exits with peer_failed_connection_lost() if can't read packet. */
u8 *peer_read(const tal_t *ctx, struct per_peer_state *pps);
#endif /* LIGHTNING_COMMON_PEER_IO_H */