diff options
author | Gav Wood <i@gavwood.com> | 2015-04-06 03:08:22 +0800 |
---|---|---|
committer | Gav Wood <i@gavwood.com> | 2015-04-06 03:08:22 +0800 |
commit | 0dc70c63a9009aa5ccf2da99893a426a1d6db6d5 (patch) | |
tree | e2acdd90da4b8983ed2bcbcb802adc5a3eb350b0 /blockchain.cpp | |
parent | 966407f28555d46bddfd76287198615ac1f5cc9b (diff) | |
download | dexon-solidity-0dc70c63a9009aa5ccf2da99893a426a1d6db6d5.tar dexon-solidity-0dc70c63a9009aa5ccf2da99893a426a1d6db6d5.tar.gz dexon-solidity-0dc70c63a9009aa5ccf2da99893a426a1d6db6d5.tar.bz2 dexon-solidity-0dc70c63a9009aa5ccf2da99893a426a1d6db6d5.tar.lz dexon-solidity-0dc70c63a9009aa5ccf2da99893a426a1d6db6d5.tar.xz dexon-solidity-0dc70c63a9009aa5ccf2da99893a426a1d6db6d5.tar.zst dexon-solidity-0dc70c63a9009aa5ccf2da99893a426a1d6db6d5.zip |
Move hash to a hidden function, and provide a datapath to it so avoid
unneeded SHA3s.
Diffstat (limited to 'blockchain.cpp')
-rw-r--r-- | blockchain.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/blockchain.cpp b/blockchain.cpp index 21345abf..50c17bde 100644 --- a/blockchain.cpp +++ b/blockchain.cpp @@ -52,7 +52,7 @@ void doBlockchainTests(json_spirit::mValue& _v, bool _fillin) BOOST_REQUIRE(o.count("pre")); ImportTest importer(o["pre"].get_obj()); - State state(biGenesisBlock.coinbaseAddress, OverlayDB(), BaseState::Empty); + State state(OverlayDB(), BaseState::Empty, biGenesisBlock.coinbaseAddress); importer.importState(o["pre"].get_obj(), state); o["pre"] = fillJsonWithState(state); state.commit(); @@ -599,7 +599,7 @@ void updatePoW(BlockInfo& _bi) ret = pow.mine(_bi, 10000, true, true); Ethash::assignResult(ret.second, _bi); } - _bi.hash = _bi.headerHash(WithNonce); + _bi.noteDirty(); } void writeBlockHeaderToJson(mObject& _o, BlockInfo const& _bi) @@ -619,7 +619,7 @@ void writeBlockHeaderToJson(mObject& _o, BlockInfo const& _bi) _o["extraData"] ="0x" + toHex(_bi.extraData); _o["mixHash"] = toString(_bi.mixHash); _o["nonce"] = toString(_bi.nonce); - _o["hash"] = toString(_bi.hash); + _o["hash"] = toString(_bi.hash()); } RLPStream createFullBlockFromHeader(BlockInfo const& _bi, bytes const& _txs, bytes const& _uncles) |