Functions for disk access for blocks

Synopsis

Declared in <node/blockstorage.h>

bool
ReadBlock(
    CBlock& block,
    FlatFilePos const& pos,
    std::optional<uint256> const& expected_hash) const;

Return Value

True on success, false if the block could not be read or verified.

Parameters

Name

Description

block

Output filled with the deserialized block.

pos

Position of the serialized block on disk.

expected_hash

Expected block hash used to verify the read, if provided.

Created with MrDocs