node::BlockManager::ReadBlock

ReadBlock overloads

Synopses

Declared in <node/blockstorage.h>

Read a block from disk using its block index entry.

bool
ReadBlock(
    CBlock& block,
    CBlockIndex const& index) const;
» more...

Functions for disk access for blocks

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

Return Value

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

Parameters

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