Browse Source

Fix empty unclesHash for Genesis

cl-refactor
nicksavers 10 years ago
parent
commit
5149609e15
  1. 1
      libdevcrypto/SHA3.cpp
  2. 2
      libdevcrypto/SHA3.h
  3. 2
      libethcore/BlockInfo.cpp
  4. 2
      libethereum/BlockChain.cpp

1
libdevcrypto/SHA3.cpp

@ -30,6 +30,7 @@ namespace dev
{
h256 EmptySHA3 = sha3(bytesConstRef());
h256 EmptyListSHA3 = sha3(RLPEmptyList);
std::string sha3(std::string const& _input, bool _hex)
{

2
libdevcrypto/SHA3.h

@ -58,6 +58,8 @@ inline h256 sha3(std::string const& _input) { return sha3(bytesConstRef(_input))
extern h256 EmptySHA3;
extern h256 EmptyListSHA3;
// Other crypto convenience routines
bytes aesDecrypt(bytesConstRef _cipher, std::string const& _password, unsigned _rounds = 2000, bytesConstRef _salt = bytesConstRef());

2
libethcore/BlockInfo.cpp

@ -56,8 +56,6 @@ h256 BlockInfo::headerHashWithoutNonce() const
return sha3(s.out());
}
auto static const c_sha3EmptyList = sha3(RLPEmptyList);
void BlockInfo::streamRLP(RLPStream& _s, bool _nonce) const
{
_s.appendList(_nonce ? 15 : 14)

2
libethereum/BlockChain.cpp

@ -103,7 +103,7 @@ bytes BlockChain::createGenesisBlock()
block.appendList(15)
// TODO: maybe make logbloom correct?
<< h256() << EmptySHA3 << h160() << stateRoot << EmptyTrie << EmptyTrie << LogBloom() << c_genesisDifficulty << 0 << 0 << 1000000 << 0 << (unsigned)0 << string() << sha3(bytes(1, 42));
<< h256() << EmptyListSHA3 << h160() << stateRoot << EmptyTrie << EmptyTrie << LogBloom() << c_genesisDifficulty << 0 << 0 << 1000000 << 0 << (unsigned)0 << string() << sha3(bytes(1, 42));
block.appendRaw(RLPEmptyList);
block.appendRaw(RLPEmptyList);
return block.out();

Loading…
Cancel
Save