Function grin_p2p::msg::read_header

source ยท
pub fn read_header<R: Read>(
    stream: &mut R,
    version: ProtocolVersion
) -> Result<MsgHeaderWrapper, Error>
Expand description

Read a header from the provided stream without blocking if the underlying stream is async. Typically headers will be polled for, so we do not want to block.

Note: We return a MsgHeaderWrapper here as we may encounter an unknown msg type.