From d74eb47e35f9d204114bf1e71e9aa2e269071e58 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Sat, 25 Jul 2015 00:30:16 +0200 Subject: [PATCH] Fix BadRoot. --- libethereum/State.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libethereum/State.cpp b/libethereum/State.cpp index fd428ec73..212ee33fe 100644 --- a/libethereum/State.cpp +++ b/libethereum/State.cpp @@ -742,8 +742,9 @@ u256 State::enact(VerifiedBlockRef const& _block, BlockChain const& _bc) // Hash the state trie and check against the state_root hash in m_currentBlock. if (m_currentBlock.stateRoot() != m_previousBlock.stateRoot() && m_currentBlock.stateRoot() != rootHash()) { + auto r = rootHash(); m_db.rollback(); - BOOST_THROW_EXCEPTION(InvalidStateRoot() << Hash256RequirementError(rootHash(), m_currentBlock.stateRoot())); + BOOST_THROW_EXCEPTION(InvalidStateRoot() << Hash256RequirementError(r, m_currentBlock.stateRoot())); } if (m_currentBlock.gasUsed() != gasUsed())