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

Function write_encrypted_to_peer

connectd/multiplex.c:505–518  ·  view source on GitHub ↗

(Continue) writing the encrypted_peer_out array */

Source from the content-addressed store, hash-verified

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