node::BlockManager::ReadBlock

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

NameDescription
blockOutput filled with the deserialized block.
posPosition of the serialized block on disk.
expected_hashExpected block hash used to verify the read, if provided.