Browse Source

Merge remote-tracking branch 'upstream/develop' into develop

cl-refactor
Christoph Jentzsch 10 years ago
parent
commit
ae7542dc2b
  1. 2
      libdevcore/Common.cpp
  2. 20
      libdevcore/CommonIO.h
  3. 3
      libethereum/BlockChain.cpp
  4. 4
      libethereum/EthereumHost.cpp
  5. 1
      libp2p/Host.cpp
  6. 2
      libqethereum/CMakeLists.txt
  7. 2
      package.sh
  8. 1
      sc/cmdline.cpp
  9. 18
      windows/Alethzero.vcxproj
  10. 2
      windows/Ethereum.sln
  11. 6
      windows/LibEthereum.vcxproj.filters

2
libdevcore/Common.cpp

@ -27,7 +27,7 @@ using namespace dev;
namespace dev
{
char const* Version = "0.6.8d";
char const* Version = "0.6.9";
}

20
libdevcore/CommonIO.h

@ -49,15 +49,6 @@ void writeFile(std::string const& _file, bytes const& _data);
/// Nicely renders the given bytes to a string, optionally as HTML.
std::string memDump(bytes const& _b, unsigned _w = 8, bool _html = false);
/// Converts arbitrary value to string representation using std::stringstream.
template <class _T>
std::string toString(_T const& _t)
{
std::ostringstream o;
o << _t;
return o.str();
}
// Stream I/O functions.
// Provides templated stream I/O for all STL collections so they can be shifted on to any iostream-like interface.
@ -223,4 +214,15 @@ template <class T, class U> inline std::ostream& operator<<(std::ostream& _out,
template <class _S, class _T> _S& operator<<(_S& _out, std::shared_ptr<_T> const& _p) { if (_p) _out << "@" << (*_p); else _out << "nullptr"; return _out; }
// Functions that use streaming stuff.
/// Converts arbitrary value to string representation using std::stringstream.
template <class _T>
std::string toString(_T const& _t)
{
std::ostringstream o;
o << _t;
return o.str();
}
}

3
libethereum/BlockChain.cpp

@ -275,7 +275,8 @@ h256s BlockChain::import(bytes const& _block, OverlayDB const& _db)
}
auto pd = details(bi.parentHash);
assert(pd);
if (!pd)
cwarn << "Odd: details is returning false despite block known:" << RLP(pd.rlp());
// Check it's not crazy
if (bi.timestamp > (u256)time(0))

4
libethereum/EthereumHost.cpp

@ -183,7 +183,7 @@ void EthereumHost::doWork()
void EthereumHost::maintainTransactions(TransactionQueue& _tq, h256 _currentHash)
{
bool resendAll = (_currentHash != m_latestBlockSent);
bool resendAll = (m_grabbing == Grabbing::Nothing && m_chain.isKnown(m_latestBlockSent) && _currentHash != m_latestBlockSent);
{
lock_guard<recursive_mutex> l(m_incomingLock);
for (auto it = m_incomingTransactions.begin(); it != m_incomingTransactions.end(); ++it)
@ -251,7 +251,7 @@ void EthereumHost::maintainBlocks(BlockQueue& _bq, h256 _currentHash)
}
// If we've finished our initial sync send any new blocks.
if (m_grabbing == Grabbing::Nothing && m_chain.details(m_latestBlockSent) && m_chain.details(m_latestBlockSent).totalDifficulty < m_chain.details(_currentHash).totalDifficulty)
if (m_grabbing == Grabbing::Nothing && m_chain.isKnown(m_latestBlockSent) && m_chain.details(m_latestBlockSent).totalDifficulty < m_chain.details(_currentHash).totalDifficulty)
{
RLPStream ts;
EthereumPeer::prep(ts);

1
libp2p/Host.cpp

@ -381,6 +381,7 @@ void Host::connect(std::string const& _addr, unsigned short _port) noexcept
}
else
connect(bi::tcp::endpoint(bi::address::from_string(_addr), _port));
break;
}
catch (exception const& e)
{

2
libqethereum/CMakeLists.txt

@ -105,6 +105,6 @@ else ()
target_link_libraries(${EXECUTABLE} boost_filesystem)
find_package(Threads REQUIRED)
target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT})
install( TARGETS ${EXECUTABLE} RUNTIME DESTINATION bin )
install( TARGETS ${EXECUTABLE} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib )
endif ()

2
package.sh

@ -3,7 +3,7 @@
opwd="$PWD"
br=$(git branch | grep '\*' | sed 's/^..//')
n=cpp-ethereum-src-$(date "+%Y%m%d%H%M%S" --date="1970-01-01 $(git log -1 --date=short --pretty=format:%ct) sec GMT")-$(grep "EthVersion = " libethential/Common.cpp | sed 's/^[^"]*"//' | sed 's/".*$//')-$(git rev-parse HEAD | cut -c1-6)
n=cpp-ethereum-src-$(date "+%Y%m%d%H%M%S" --date="1970-01-01 $(git log -1 --date=short --pretty=format:%ct) sec GMT")-$(grep "Version = " libdevcore/Common.cpp | sed 's/^[^"]*"//' | sed 's/".*$//')-$(git rev-parse HEAD | cut -c1-6)
cd /tmp
git clone "$opwd" $n

1
sc/cmdline.cpp

@ -3,6 +3,7 @@
#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <libserpent/funcs.h>
int main(int argv, char** argc) {

18
windows/Alethzero.vcxproj

@ -209,6 +209,24 @@
</CustomBuild>
<ClInclude Include="..\alethzero\Grapher.h" />
<ClInclude Include="..\alethzero\GraphParameters.h" />
<CustomBuild Include="..\alethzero\DownloadView.h">
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Lua) moc.lua "$(QtBin)/moc" "$(IntDir)moc_%(FileName).cpp" "@(ClCompile->'%(AdditionalIncludeDirectories)');$(IncludePath)" "@(ClCompile->'%(PreprocessorDefinitions)');_MSC_VER=1800" "%(FullPath)"</Command>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Lua) moc.lua "$(QtBin)/moc" "$(IntDir)moc_%(FileName).cpp" "@(ClCompile->'%(AdditionalIncludeDirectories)');$(IncludePath)" "@(ClCompile->'%(PreprocessorDefinitions)');_MSC_VER=1800" "%(FullPath)"</Command>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Lua) moc.lua "$(QtBin)/moc" "$(IntDir)moc_%(FileName).cpp" "@(ClCompile->'%(AdditionalIncludeDirectories)');$(IncludePath)" "@(ClCompile->'%(PreprocessorDefinitions)');_MSC_VER=1800" "%(FullPath)"</Command>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Lua) moc.lua "$(QtBin)/moc" "$(IntDir)moc_%(FileName).cpp" "@(ClCompile->'%(AdditionalIncludeDirectories)');$(IncludePath)" "@(ClCompile->'%(PreprocessorDefinitions)');_MSC_VER=1800" "%(FullPath)"</Command>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)moc_%(FileName).cpp</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)moc_%(FileName).cpp</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IntDir)moc_%(FileName).cpp</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)moc_%(FileName).cpp</Outputs>
</CustomBuild>
<CustomBuild Include="..\alethzero\MiningView.h">
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Lua) moc.lua "$(QtBin)/moc" "$(IntDir)moc_%(FileName).cpp" "@(ClCompile->'%(AdditionalIncludeDirectories)');$(IncludePath)" "@(ClCompile->'%(PreprocessorDefinitions)');_MSC_VER=1800" "%(FullPath)"</Command>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">

2
windows/Ethereum.sln

@ -23,8 +23,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LibMiniUPnPc", "LibMiniUPnP
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AlethZero", "Alethzero.vcxproj", "{BFCFFC46-78A3-4350-9938-0EA3A2B1CCCD}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Walleth", "Walleth.vcxproj", "{326EF470-463F-4751-A22A-48BBAAD8B143}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LibQEthereum", "LibQEthereum.vcxproj", "{DF3C5B07-A1A2-4F16-B37F-A27333622CDD}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "eth", "Eth.vcxproj", "{C60C065C-2135-4B2B-AFD4-35FD7AC56B40}"

6
windows/LibEthereum.vcxproj.filters

@ -175,6 +175,9 @@
<ClCompile Include="..\libwhisper\WhisperPeer.cpp">
<Filter>libwhisper</Filter>
</ClCompile>
<ClCompile Include="..\libethereum\Manifest.cpp">
<Filter>libethereum</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="stdafx.h">
@ -384,6 +387,9 @@
<ClInclude Include="..\libwhisper\WhisperPeer.h">
<Filter>libwhisper</Filter>
</ClInclude>
<ClInclude Include="..\libethereum\Manifest.h">
<Filter>libethereum</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Filter Include="Windows">

Loading…
Cancel
Save