Browse Source

Merge branch 'develop' of github.com:ethereum/cpp-ethereum into develop

cl-refactor
Gav Wood 10 years ago
parent
commit
d2e84c1a46
  1. 2
      .gitignore
  2. 18
      libethcore/Ethasher.cpp
  3. 2
      libevmcore/Assembly.h

2
.gitignore

@ -64,6 +64,8 @@ profile
DerivedData
project.pbxproj
# JetBrains stuff
.idea/
doc/html
*.autosave

18
libethcore/Ethasher.cpp

@ -45,18 +45,9 @@ bytes const& Ethasher::cache(BlockInfo const& _header)
RecursiveGuard l(x_this);
if (!m_caches.count(_header.seedHash))
{
try {
boost::filesystem::create_directories(getDataDir() + "/ethashcache");
} catch (...) {}
std::string memoFile = getDataDir() + "/ethashcache/" + toHex(_header.seedHash.ref().cropped(0, 4)) + ".cache";
m_caches[_header.seedHash] = contents(memoFile);
if (m_caches[_header.seedHash].empty())
{
ethash_params p = params((unsigned)_header.number);
m_caches[_header.seedHash].resize(p.cache_size);
ethash_prep_light(m_caches[_header.seedHash].data(), &p, _header.seedHash.data());
writeFile(memoFile, m_caches[_header.seedHash]);
}
ethash_params p = params((unsigned)_header.number);
m_caches[_header.seedHash].resize(p.cache_size);
ethash_prep_light(m_caches[_header.seedHash].data(), &p, _header.seedHash.data());
}
return m_caches[_header.seedHash];
}
@ -71,6 +62,9 @@ bytesConstRef Ethasher::full(BlockInfo const& _header)
delete [] m_fulls.begin()->second.data();
m_fulls.erase(m_fulls.begin());
}
try {
boost::filesystem::create_directories(getDataDir() + "/ethashcache");
} catch (...) {}
std::string memoFile = getDataDir() + "/ethashcache/" + toHex(_header.seedHash.ref().cropped(0, 4)) + ".full";
m_fulls[_header.seedHash] = contentsNew(memoFile);
if (!m_fulls[_header.seedHash])

2
libevmcore/Assembly.h

@ -71,7 +71,7 @@ private:
AssemblyItemType m_type;
u256 m_data;
SourceLocation m_location;
JumpType m_jumpType;
JumpType m_jumpType = JumpType::Ordinary;
};
using AssemblyItems = std::vector<AssemblyItem>;

Loading…
Cancel
Save