pub fn send_message(&self, node_id: PublicKey, msg: Message) {
        if msg.serialized_length() > MAX_BUF_SIZE {
            let (seg_start, seg_chunks) = get_segments(msg.encode(), msg.type_id());
            let mut msg_events = self.msg_events.lock().unwrap();
            msg_events.push_back((node_id, WireMessage::SegmentStart(seg_start)));
            for chunk in seg_chunks {
                msg_events.push_back((node_id, WireMessage::SegmentChunk(chunk)));
            }
        } else {
            self.msg_events
                .lock()
                .unwrap()
                .push_back((node_id, WireMessage::Message(msg)));
        }
    }
/// Send a message to the peer with given node id. Not that the message is not
/// sent right away, but only when the LDK
/// [`lightning::ln::peer_handler::PeerManager::process_events`] is next called.
Send a message to the peer with given node id.
Send a message to the peer with given node id .
pub fn send_message(&self, node_id: PublicKey, msg: Message) {
        if msg.serialized_length() > MAX_BUF_SIZE {
            let (seg_start, seg_chunks) = get_segments(msg.encode(), msg.type_id());
            let mut msg_events = self.msg_events.lock().unwrap();
            msg_events.push_back((node_id, WireMessage::SegmentStart(seg_start)));
            for chunk in seg_chunks {
                msg_events.push_back((node_id, WireMessage::SegmentChunk(chunk)));
            }
        } else {
            self.msg_events
                .lock()
                .unwrap()
                .push_back((node_id, WireMessage::Message(msg)));
        }
    }
pub fn send_message ( & self , node_id : PublicKey , msg : Message ) { if msg . serialized_length ( ) > MAX_BUF_SIZE { let ( seg_start , seg_chunks ) = get_segments ( msg . encode ( ) , msg . type_id ( ) ) ; let mut msg_events = self . msg_events . lock ( ) . unwrap ( ) ; msg_events . push_back ( ( node_id , WireMessage :: SegmentStart ( seg_start ) ) ) ; for chunk in seg_chunks { msg_events . push_back ( ( node_id , WireMessage :: SegmentChunk ( chunk ) ) ) ; } } else { self . msg_events . lock ( ) . unwrap ( ) . push_back ( ( node_id , WireMessage :: Message ( msg ) ) ) ; } }
Send a message to the peer with given node id.
Send a message to the peer with given node id .
&self
node_id
PublicKey
msg
Message