Browse Source

Fix database path issue, fix extradata max size to 1024 for olympic only.

cl-refactor
Gav Wood 9 years ago
parent
commit
e763a3f038
  1. 2
      libethcore/Params.cpp
  2. 3
      libethereum/BlockChain.cpp
  3. 4
      libethereum/BlockChain.h
  4. 2
      libethereum/Client.cpp

2
libethcore/Params.cpp

@ -30,7 +30,7 @@ namespace eth
//--- BEGIN: AUTOGENERATED FROM github.com/ethereum/common/params.json
u256 const c_genesisDifficulty = 131072;
u256 const c_maximumExtraDataSize = 32;
u256 const c_maximumExtraDataSize = c_network == Network::Olympic ? 1024 : 32;
u256 const c_genesisGasLimit = c_network == Network::Turbo ? 100000000 : 3141592;
u256 const c_minGasLimit = c_network == Network::Turbo ? 100000000 : 125000;
u256 const c_gasLimitBoundDivisor = 1024;

3
libethereum/BlockChain.cpp

@ -146,7 +146,8 @@ static const unsigned c_minCacheSize = 1024 * 1024 * 32;
#endif
BlockChain::BlockChain(bytes const& _genesisBlock, std::unordered_map<Address, Account> const& _genesisState, std::string const& _path, WithExisting _we, ProgressCallback const& _p)
BlockChain::BlockChain(bytes const& _genesisBlock, std::unordered_map<Address, Account> const& _genesisState, std::string const& _path, WithExisting _we, ProgressCallback const& _p):
m_dbPath(_path)
{
open(_genesisBlock, _genesisState, _path, _we, _p);
}

4
libethereum/BlockChain.h

@ -107,7 +107,7 @@ public:
~BlockChain();
/// Reopen everything.
virtual void reopen(std::string const& _path, WithExisting _we = WithExisting::Trust, ProgressCallback const& _pc = ProgressCallback()) { close(); open(m_genesisBlock, m_genesisState, _path, _we, _pc); }
virtual void reopen(WithExisting _we = WithExisting::Trust, ProgressCallback const& _pc = ProgressCallback()) { close(); open(m_genesisBlock, m_genesisState, m_dbPath, _we, _pc); }
/// (Potentially) renders invalid existing bytesConstRef returned by lastBlock.
/// To be called from main loop every 100ms or so.
@ -377,6 +377,8 @@ protected:
std::function<void(Exception&)> m_onBad; ///< Called if we have a block that doesn't verify.
std::string m_dbPath;
friend std::ostream& operator<<(std::ostream& _out, BlockChain const& _bc);
};

2
libethereum/Client.cpp

@ -348,7 +348,7 @@ void Client::reopenChain(WithExisting _we)
m_working = State();
m_stateDB = OverlayDB();
bc().reopen(Defaults::dbPath(), _we);
bc().reopen(_we);
m_stateDB = State::openDB(Defaults::dbPath(), bc().genesisHash(), _we);
m_preMine = bc().genesisState(m_stateDB);

Loading…
Cancel
Save