Browse Source

PoC-5 premine & YP updates.

cl-refactor
Gav Wood 11 years ago
parent
commit
f5def8f2fd
  1. 2
      alethzero/MainWin.cpp
  2. 2
      libethereum/BlockInfo.cpp
  3. 2
      libethereum/CommonEth.cpp
  4. 4
      libethereum/State.cpp

2
alethzero/MainWin.cpp

@ -199,6 +199,8 @@ Main::Main(QWidget *parent) :
} }
#endif #endif
cnote << "State root: " << BlockInfo::genesis().stateRoot;
cnote << "Genesis hash:" << sha3(BlockInfo::createGenesisBlock());
cnote << "Genesis RLP:" << toHex(BlockInfo::createGenesisBlock()); cnote << "Genesis RLP:" << toHex(BlockInfo::createGenesisBlock());
ui->configDock->close(); ui->configDock->close();

2
libethereum/BlockInfo.cpp

@ -181,7 +181,7 @@ u256 BlockInfo::calculateGasLimit(BlockInfo const& _parent) const
if (!parentHash) if (!parentHash)
return 1000000; return 1000000;
else else
return (_parent.gasLimit * (1024 - 1) + (_parent.gasUsed * 6 / 5)) / 1024; return max<u256>(10000, (_parent.gasLimit * (1024 - 1) + (_parent.gasUsed * 6 / 5)) / 1024);
} }
u256 BlockInfo::calculateDifficulty(BlockInfo const& _parent) const u256 BlockInfo::calculateDifficulty(BlockInfo const& _parent) const

2
libethereum/CommonEth.cpp

@ -28,7 +28,7 @@ using namespace eth;
//#define ETH_ADDRESS_DEBUG 1 //#define ETH_ADDRESS_DEBUG 1
const unsigned eth::c_protocolVersion = 15; const unsigned eth::c_protocolVersion = 16;
static const vector<pair<u256, string>> g_units = static const vector<pair<u256, string>> g_units =
{ {

4
libethereum/State.cpp

@ -47,6 +47,8 @@ std::map<Address, AddressState> const& eth::genesisState()
s_ret[Address(fromHex("e6716f9544a56c530d868e4bfbacb172315bdead"))] = AddressState(u256(1) << 200, 0, h256(), EmptySHA3); s_ret[Address(fromHex("e6716f9544a56c530d868e4bfbacb172315bdead"))] = AddressState(u256(1) << 200, 0, h256(), EmptySHA3);
s_ret[Address(fromHex("1e12515ce3e0f817a4ddef9ca55788a1d66bd2df"))] = AddressState(u256(1) << 200, 0, h256(), EmptySHA3); s_ret[Address(fromHex("1e12515ce3e0f817a4ddef9ca55788a1d66bd2df"))] = AddressState(u256(1) << 200, 0, h256(), EmptySHA3);
s_ret[Address(fromHex("1a26338f0d905e295fccb71fa9ea849ffa12aaf4"))] = AddressState(u256(1) << 200, 0, h256(), EmptySHA3); s_ret[Address(fromHex("1a26338f0d905e295fccb71fa9ea849ffa12aaf4"))] = AddressState(u256(1) << 200, 0, h256(), EmptySHA3);
s_ret[Address(fromHex("2ef47100e0787b915105fd5e3f4ff6752079d5cb"))] = AddressState(u256(1) << 200, 0, h256(), EmptySHA3);
s_ret[Address(fromHex("cd2a3d9f938e13cd947ec05abc7fe734df8dd826"))] = AddressState(u256(1) << 200, 0, h256(), EmptySHA3);
} }
return s_ret; return s_ret;
} }
@ -82,10 +84,8 @@ State::State(Address _coinbaseAddress, Overlay const& _db):
m_state.init(); m_state.init();
eth::commit(genesisState(), m_db, m_state); eth::commit(genesisState(), m_db, m_state);
m_db.commit(); m_db.commit();
cnote << "State root: " << m_state.root();
m_previousBlock = BlockInfo::genesis(); m_previousBlock = BlockInfo::genesis();
cnote << "Genesis hash:" << m_previousBlock.hash;
resetCurrent(); resetCurrent();
assert(m_state.root() == m_previousBlock.stateRoot); assert(m_state.root() == m_previousBlock.stateRoot);

Loading…
Cancel
Save