ckb_shared/
block_status.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! Provide BlockStatus
#![allow(missing_docs)]
#![allow(clippy::bad_bit_mask)]

use bitflags::bitflags;
bitflags! {
    pub struct BlockStatus: u32 {
        const UNKNOWN                 =     0;

        const HEADER_VALID            =     1;
        const BLOCK_RECEIVED          =     1 | Self::HEADER_VALID.bits << 1;
        const BLOCK_STORED            =     1 | Self::BLOCK_RECEIVED.bits << 1;
        const BLOCK_VALID             =     1 | Self::BLOCK_STORED.bits << 1;

        const BLOCK_INVALID           =     1 << 12;
    }
}