From 876d1d25e2803e702c5e5ec0c36b2d840794bf92 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Thu, 23 Jul 2015 18:44:48 +0200 Subject: [PATCH] Add extradata into diagnostics. --- libethereum/BlockChain.h | 8 +++++--- libethereum/State.h | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/libethereum/BlockChain.h b/libethereum/BlockChain.h index 415581f29..49b65243e 100644 --- a/libethereum/BlockChain.h +++ b/libethereum/BlockChain.h @@ -393,10 +393,10 @@ public: virtual VerifiedBlockRef verifyBlock(bytesConstRef _block, std::function const& _onBad, ImportRequirements::value _ir) const override { VerifiedBlockRef res; - + BlockHeader h; try { - BlockHeader h(_block, (_ir & ImportRequirements::ValidSeal) ? Strictness::CheckEverything : Strictness::QuickNonce); + h = BlockHeader(_block, (_ir & ImportRequirements::ValidSeal) ? Strictness::CheckEverything : Strictness::QuickNonce); h.verifyInternals(_block); if ((_ir & ImportRequirements::Parent) != 0) { @@ -412,6 +412,7 @@ public: ex << errinfo_phase(1); ex << errinfo_now(time(0)); ex << errinfo_block(_block.toBytes()); + ex << errinfo_extraData(h.extraData()); if (_onBad) _onBad(ex); throw; @@ -424,7 +425,7 @@ public: { try { - BlockHeader().populateFromHeader(RLP(uncle.data()), (_ir & ImportRequirements::UncleSeals) ? Strictness::CheckEverything : Strictness::IgnoreSeal); + h.populateFromHeader(RLP(uncle.data()), (_ir & ImportRequirements::UncleSeals) ? Strictness::CheckEverything : Strictness::IgnoreSeal); } catch (Exception& ex) { @@ -432,6 +433,7 @@ public: ex << errinfo_uncleIndex(i); ex << errinfo_now(time(0)); ex << errinfo_block(_block.toBytes()); + ex << errinfo_extraData(h.extraData()); if (_onBad) _onBad(ex); throw; diff --git a/libethereum/State.h b/libethereum/State.h index a5d3764af..b6349d40b 100644 --- a/libethereum/State.h +++ b/libethereum/State.h @@ -52,6 +52,7 @@ using errinfo_uncleNumber = boost::error_info; using errinfo_unclesExcluded = boost::error_info; using errinfo_block = boost::error_info; using errinfo_now = boost::error_info; +using errinfo_extraData = boost::error_info; using errinfo_transactionIndex = boost::error_info;