Browse Source

Mention extraData in bad blocks and fix earlier verification.

cl-refactor
Gav Wood 10 years ago
parent
commit
21bcec4039
  1. 1
      libethereum/BlockChain.h
  2. 11
      libethereum/Client.cpp
  3. 2
      libwebthree/WebThree.cpp

1
libethereum/BlockChain.h

@ -423,6 +423,7 @@ public:
if (_ir && ImportRequirements::UncleBasic)
for (auto const& uncle: r[2])
{
BlockHeader h;
try
{
h.populateFromHeader(RLP(uncle.data()), (_ir & ImportRequirements::UncleSeals) ? Strictness::CheckEverything : Strictness::IgnoreSeal);

11
libethereum/Client.cpp

@ -217,6 +217,17 @@ void Client::onBadBlock(Exception& _ex) const
report["hints"]["ethashResult"]["value"] = get<0>(*r).hex();
report["hints"]["ethashResult"]["mixHash"] = get<1>(*r).hex();
}
if (bytes const* ed = boost::get_error_info<errinfo_extraData>(_ex))
{
RLP r(*ed);
report["hints"]["extraData"] = toHex(*ed);
try
{
if (r[0].toInt<int>() == 0)
report["hints"]["minerVersion"] = r[1].toString();
}
catch (...) {}
}
DEV_HINT_ERRINFO(required);
DEV_HINT_ERRINFO(got);
DEV_HINT_ERRINFO_HASH(required_LogBloom);

2
libwebthree/WebThree.cpp

@ -53,7 +53,7 @@ WebThreeDirect::WebThreeDirect(
if (_interfaces.count("eth"))
{
m_ethereum.reset(new eth::EthashClient(&m_net, shared_ptr<GasPricer>(), _dbPath, _we, 0));
m_ethereum->setExtraData(rlpList(0, _clientVersion, m_net.id()));
m_ethereum->setExtraData(rlpList(0, _clientVersion));
}
if (_interfaces.count("shh"))

Loading…
Cancel
Save