This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void BlockChain::insert(bytes const& _block, bytesConstRef _receipts, bool _mustBeNew) | |
{ | |
// VERIFY: populates from the block and checks the block is internally coherent. | |
VerifiedBlockRef block; | |
#if ETH_CATCH | |
try | |
#endif | |
{ | |
block = verifyBlock(&_block, m_onBad, ImportRequirements::OutOfOrderChecks); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VerifiedBlockRef BlockChain::verifyBlock(bytesConstRef _block, std::function<void(Exception&)> const& _onBad, ImportRequirements::value _ir) const | |
{ | |
VerifiedBlockRef res; | |
BlockHeader h; | |
try | |
{ | |
h = BlockHeader(_block); | |
if (!!(_ir & ImportRequirements::PostGenesis) && (!h.parentHash() || h.number() == 0)) | |
BOOST_THROW_EXCEPTION(InvalidParentHash() << errinfo_required_h256(h.parentHash()) << errinfo_currentNumber(h.number())); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @file BlockChain.h | |
* @author Gav Wood <[email protected]> | |
* @date 2014 | |
*/ | |
#pragma once | |
#include "Account.h" | |
#include "BlockDetails.h" |