#[repr(C)]pub struct NodeData {
pub consensus_branch_id: u32,
pub subtree_commitment: [u8; 32],
pub start_time: u32,
pub end_time: u32,
pub start_target: u32,
pub end_target: u32,
pub start_sapling_root: [u8; 32],
pub end_sapling_root: [u8; 32],
pub subtree_total_work: U256,
pub start_height: u64,
pub end_height: u64,
pub sapling_tx: u64,
}Expand description
V1 node metadata.
Fields§
§consensus_branch_id: u32Consensus branch id, should be provided by deserializing node.
subtree_commitment: [u8; 32]Subtree commitment - either block hash for leaves or hashsum of children for nodes.
start_time: u32Start time.
end_time: u32End time.
start_target: u32Start target.
end_target: u32End target.
start_sapling_root: [u8; 32]Start sapling tree root.
end_sapling_root: [u8; 32]End sapling tree root.
subtree_total_work: U256Part of tree total work.
start_height: u64Start height.
end_height: u64End height
sapling_tx: u64Number of Sapling transactions.
Implementations§
Source§impl NodeData
impl NodeData
Sourcepub fn read<R: Read>(consensus_branch_id: u32, r: &mut R) -> Result<Self>
pub fn read<R: Read>(consensus_branch_id: u32, r: &mut R) -> Result<Self>
Read from the byte representation.
§Errors
Returns corez::io::ErrorKind::InvalidData if a compact-encoded field
uses a non-canonical encoding, or if the encoded height range is
descending or contains more blocks than can be represented by a u64.
Sourcepub fn from_bytes<T: AsRef<[u8]>>(
consensus_branch_id: u32,
buf: T,
) -> Result<Self>
pub fn from_bytes<T: AsRef<[u8]>>( consensus_branch_id: u32, buf: T, ) -> Result<Self>
Convert from byte representation.
§Errors
Returns corez::io::ErrorKind::InvalidData if a compact-encoded field
uses a non-canonical encoding, or if the encoded height range is
descending or contains more blocks than can be represented by a u64.