Browse Source

Always populate transaction in verifyBlock.

cl-refactor
Gav Wood 10 years ago
parent
commit
f7b90247bd
  1. 4
      libethereum/BlockChain.cpp
  2. 4
      libethereum/State.cpp

4
libethereum/BlockChain.cpp

@ -436,7 +436,7 @@ pair<ImportResult, ImportRoute> BlockChain::attemptImport(bytes const& _block, O
{
try
{
return make_pair(ImportResult::Success, import(verifyBlock(&_block, m_onBad, _ir), _stateDB, _ir));
return make_pair(ImportResult::Success, import(verifyBlock(&_block, m_onBad, _ir), _stateDB, _ir | ImportRequirements::TransactionBasic));
}
catch (UnknownParent&)
{
@ -467,7 +467,7 @@ ImportRoute BlockChain::import(bytes const& _block, OverlayDB const& _db, Import
try
#endif
{
block = verifyBlock(&_block, m_onBad, _ir);
block = verifyBlock(&_block, m_onBad, _ir | ImportRequirements::TransactionBasic);
}
#if ETH_CATCH
catch (Exception& ex)

4
libethereum/State.cpp

@ -136,7 +136,7 @@ PopulationStatistics State::populateFromChain(BlockChain const& _bc, h256 const&
// 2. Enact the block's transactions onto this state.
m_ourAddress = bi.coinbaseAddress();
Timer t;
auto vb = _bc.verifyBlock(&b, function<void(Exception&)>(), _ir);
auto vb = _bc.verifyBlock(&b, function<void(Exception&)>(), _ir | ImportRequirements::TransactionBasic);
ret.verify = t.elapsed();
t.restart();
enact(vb, _bc);
@ -651,7 +651,7 @@ u256 State::enact(VerifiedBlockRef const& _block, BlockChain const& _bc)
InvalidReceiptsStateRoot ex;
ex << Hash256RequirementError(receiptsRoot, m_currentBlock.receiptsRoot());
ex << errinfo_receipts(receipts);
ex << errinfo_vmtrace(vmTrace(_block.block, _bc, ImportRequirements::None));
// ex << errinfo_vmtrace(vmTrace(_block.block, _bc, ImportRequirements::None));
BOOST_THROW_EXCEPTION(ex);
}

Loading…
Cancel
Save