Browse Source

const-correctness for BlockChain::genesisBlock.

cl-refactor
Gav Wood 9 years ago
parent
commit
04ed2d1952
  1. 2
      libethereum/BlockChain.cpp
  2. 2
      libethereum/BlockChain.h

2
libethereum/BlockChain.cpp

@ -1272,7 +1272,7 @@ bytes BlockChain::headerData(h256 const& _hash) const
return BlockInfo::extractHeader(&m_blocks[_hash]).data().toBytes();
}
Block BlockChain::genesisBlock(OverlayDB const& _db)
Block BlockChain::genesisBlock(OverlayDB const& _db) const
{
Block ret(_db, BaseState::Empty);
dev::eth::commit(m_genesisState, ret.mutableState().m_state); // bit horrible. maybe consider a better way of constructing it?

2
libethereum/BlockChain.h

@ -286,7 +286,7 @@ public:
template <class T> void setOnBad(T const& _t) { m_onBad = _t; }
/// Get a pre-made genesis State object.
Block genesisBlock(OverlayDB const& _db);
Block genesisBlock(OverlayDB const& _db) const;
/// Verify block and prepare it for enactment
virtual VerifiedBlockRef verifyBlock(bytesConstRef _block, std::function<void(Exception&)> const& _onBad, ImportRequirements::value _ir = ImportRequirements::OutOfOrderChecks) const = 0;

Loading…
Cancel
Save