Skip to main content

data_len

Function data_len 

Source
fn data_len(item: &UnparsedRelayMsg) -> u16
Expand description

The length field of the message, or 0 if not a data message.

If the RELAY_DATA message had an invalid length field, we just ignore the message. The receiver will find out eventually when it tries to parse the message. We could return an error here, but for now I think it’s best not to behave as if this queue is performing any validation.

This is its own function so that all parts of the code use the same logic.