Skip to main content

validate_block

Function validate_block 

Source
pub fn validate_block(block_data: &[u8]) -> bool
Expand description

Validate an SBF block’s CRC

§Arguments

  • block_data - Complete block data starting from sync bytes (0x24 0x40)

§Returns

true if the CRC is valid, false otherwise

§Block Structure

[Sync: 2] [CRC: 2] [ID: 2] [Length: 2] [Body: Length-8]

CRC is calculated over [ID + Length + Body], i.e., from offset 4 to end