aboutsummaryrefslogtreecommitdiffstats
path: root/vm.cpp
diff options
context:
space:
mode:
authorGav Wood <i@gavwood.com>2015-04-06 03:08:22 +0800
committerGav Wood <i@gavwood.com>2015-04-06 03:08:22 +0800
commit0dc70c63a9009aa5ccf2da99893a426a1d6db6d5 (patch)
treee2acdd90da4b8983ed2bcbcb802adc5a3eb350b0 /vm.cpp
parent966407f28555d46bddfd76287198615ac1f5cc9b (diff)
downloaddexon-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 'vm.cpp')
-rw-r--r--vm.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/vm.cpp b/vm.cpp
index cffbaa64..ff890352 100644
--- a/vm.cpp
+++ b/vm.cpp
@@ -96,7 +96,7 @@ void FakeExtVM::push(mArray& a, u256 _v)
mObject FakeExtVM::exportEnv()
{
mObject ret;
- ret["previousHash"] = toString(previousBlock.hash);
+ ret["previousHash"] = toString(currentBlock.parentHash);
push(ret, "currentDifficulty", currentBlock.difficulty);
push(ret, "currentTimestamp", currentBlock.timestamp);
ret["currentCoinbase"] = toString(currentBlock.coinbaseAddress);
@@ -115,7 +115,7 @@ void FakeExtVM::importEnv(mObject& _o)
assert(_o.count("currentCoinbase") > 0);
assert(_o.count("currentNumber") > 0);
- previousBlock.hash = h256(_o["previousHash"].get_str());
+ currentBlock.parentHash = h256(_o["previousHash"].get_str());
currentBlock.number = toInt(_o["currentNumber"]);
lastHashes = test::lastHashes(currentBlock.number);
currentBlock.gasLimit = toInt(_o["currentGasLimit"]);