aboutsummaryrefslogtreecommitdiffstats
path: root/blockchain.cpp
diff options
context:
space:
mode:
authorCJentzsch <jentzsch.software@gmail.com>2015-03-06 16:14:45 +0800
committerGav Wood <i@gavwood.com>2015-03-06 19:49:39 +0800
commit3112948e53fc756de2f80cf6cf56dbec05ede215 (patch)
tree5d184c621a6c337c9a28e48e673c05f482194b9c /blockchain.cpp
parentf0e015843d71f2204295e678e089c18afc9258e1 (diff)
downloaddexon-solidity-3112948e53fc756de2f80cf6cf56dbec05ede215.tar
dexon-solidity-3112948e53fc756de2f80cf6cf56dbec05ede215.tar.gz
dexon-solidity-3112948e53fc756de2f80cf6cf56dbec05ede215.tar.bz2
dexon-solidity-3112948e53fc756de2f80cf6cf56dbec05ede215.tar.lz
dexon-solidity-3112948e53fc756de2f80cf6cf56dbec05ede215.tar.xz
dexon-solidity-3112948e53fc756de2f80cf6cf56dbec05ede215.tar.zst
dexon-solidity-3112948e53fc756de2f80cf6cf56dbec05ede215.zip
try to have a uncle with block number = 1
Diffstat (limited to 'blockchain.cpp')
-rw-r--r--blockchain.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/blockchain.cpp b/blockchain.cpp
index e453e32a..7f840bc7 100644
--- a/blockchain.cpp
+++ b/blockchain.cpp
@@ -80,6 +80,7 @@ void doBlockchainTests(json_spirit::mValue& _v, bool _fillin)
BOOST_REQUIRE(o.count("blocks"));
mArray blArray;
vector<BlockInfo> vBiBlocks;
+ vBiBlocks.push_back(biGenesisBlock);
for (auto const& bl: o["blocks"].get_array())
{
mObject blObj = bl.get_obj();
@@ -107,7 +108,10 @@ void doBlockchainTests(json_spirit::mValue& _v, bool _fillin)
// make uncle header valid
uncleBlockFromFields.timestamp = (u256)time(0);
- uncleBlockFromFields.populateFromParent(vBiBlocks[vBiBlocks.size()-2]);
+ if (vBiBlocks.size() > 2)
+ uncleBlockFromFields.populateFromParent(vBiBlocks[vBiBlocks.size()-2]);
+ else
+ continue;
updatePoW(uncleBlockFromFields);
writeBlockHeaderToJson(uncleHeaderObj, uncleBlockFromFields);