MCPcopy Create free account
hub / github.com/ElementsProject/lightning / write_encrypted_to_peer

Function write_encrypted_to_peer

connectd/multiplex.c:502–515  ·  view source on GitHub ↗

(Continue) writing the encrypted_peer_out array */

Source from the content-addressed store, hash-verified

500
501/* (Continue) writing the encrypted_peer_out array */
502static struct io_plan *write_encrypted_to_peer(struct peer *peer)
503{
504 size_t avail = membuf_num_elems(&peer->encrypted_peer_out);
505 /* With padding: always a full uniform-size chunk.
506 * Without: flush whatever we have (caller ensures non-zero). */
507 size_t write_size = use_uniform_writes(peer) ? UNIFORM_MESSAGE_SIZE : avail;
508
509 assert(avail >= write_size && write_size > 0);
510 return io_write_partial(peer->to_peer,
511 membuf_elems(&peer->encrypted_peer_out),
512 write_size,
513 &peer->encrypted_peer_out_sent,
514 write_to_peer, peer);
515}
516
517/* Close the connection if this fails */
518static bool encrypt_append(struct peer *peer, const u8 *msg TAKES)

Callers 1

write_to_peerFunction · 0.85

Calls 1

use_uniform_writesFunction · 0.85

Tested by

no test coverage detected