mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: add missing outgoing message check (#6082)
This commit is contained in:
@ -556,6 +556,13 @@ where
|
||||
}
|
||||
|
||||
fn start_send(self: Pin<&mut Self>, item: Bytes) -> Result<(), Self::Error> {
|
||||
if item.len() > MAX_PAYLOAD_SIZE {
|
||||
return Err(P2PStreamError::MessageTooBig {
|
||||
message_size: item.len(),
|
||||
max_size: MAX_PAYLOAD_SIZE,
|
||||
})
|
||||
}
|
||||
|
||||
// ensure we have free capacity
|
||||
if !self.has_outgoing_capacity() {
|
||||
return Err(P2PStreamError::SendBufferFull)
|
||||
|
||||
Reference in New Issue
Block a user