Sufficiently validate a block for disk storage (and store on disk).

Synopsis

Declared in <validation.h>

[[requires_capability(0x7f2e1bc17a28), requires_capability(0x7f2e146b5d78), requires_capability(0x7f2e298fb148), requires_capability(0x7f2e360b88a8)]]
bool
AcceptBlock(
    std::shared_ptr<CBlock const> const& pblock,
    BlockValidationState& state,
    CBlockIndex** ppindex,
    bool fRequested,
    FlatFilePos const* dbp,
    bool* fNewBlock,
    bool min_pow_checked);

Return Value

False if the block or header is invalid, or if saving to disk fails (likely a fatal error); true otherwise.

Parameters

Name

Description

pblock [in]

The block we want to process.

fRequested [in]

Whether we requested this block from a peer.

dbp [in]

The location on disk, if we are importing this block from prior storage.

min_pow_checked [in]

True if proof‐of‐work anti‐DoS checks have been done by caller for headers chain

state [out]

The state of the block validation.

ppindex [out]

Optional return parameter to get the CBlockIndex pointer for this block.

fNewBlock [out]

Optional return parameter to indicate if the block is new to our storage.

Created with MrDocs