Browse Source

More efficient getLastHashes.

cl-refactor
Gav Wood 10 years ago
parent
commit
3387d82a9c
  1. 6
      libethereum/State.cpp

6
libethereum/State.cpp

@ -1006,9 +1006,9 @@ LastHashes State::getLastHashes(BlockChain const& _bc) const
ret.resize(256); ret.resize(256);
if (c_protocolVersion > 49) if (c_protocolVersion > 49)
{ {
unsigned n = (unsigned)m_previousBlock.number; ret[0] = _bc.currentHash();
for (unsigned i = 0; i < 256; ++i) for (unsigned i = 1; i < 256; ++i)
ret[i] = _bc.numberHash(std::max<unsigned>(n, i) - i); ret[i] = ret[i - 1] ? _bc.details(ret[i - 1]).parent : h256();
} }
return ret; return ret;
} }

Loading…
Cancel
Save