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. 20
      windows/Alethzero.vcxproj
  10. 2
      windows/Ethereum.sln
  11. 2
      windows/LibEthereum.vcxproj
  12. 6
      windows/LibEthereum.vcxproj.filters

2
libdevcore/Common.cpp

@ -27,7 +27,7 @@ using namespace dev;
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. /// Nicely renders the given bytes to a string, optionally as HTML.
std::string memDump(bytes const& _b, unsigned _w = 8, bool _html = false); 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. // Stream I/O functions.
// Provides templated stream I/O for all STL collections so they can be shifted on to any iostream-like interface. // 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; } 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); 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 // Check it's not crazy
if (bi.timestamp > (u256)time(0)) if (bi.timestamp > (u256)time(0))

4
libethereum/EthereumHost.cpp

@ -183,7 +183,7 @@ void EthereumHost::doWork()
void EthereumHost::maintainTransactions(TransactionQueue& _tq, h256 _currentHash) 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); lock_guard<recursive_mutex> l(m_incomingLock);
for (auto it = m_incomingTransactions.begin(); it != m_incomingTransactions.end(); ++it) 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 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; RLPStream ts;
EthereumPeer::prep(ts); EthereumPeer::prep(ts);

1
libp2p/Host.cpp

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

2
libqethereum/CMakeLists.txt

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

2
package.sh

@ -3,7 +3,7 @@
opwd="$PWD" opwd="$PWD"
br=$(git branch | grep '\*' | sed 's/^..//') 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 cd /tmp
git clone "$opwd" $n git clone "$opwd" $n

1
sc/cmdline.cpp

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

20
windows/Alethzero.vcxproj

@ -209,6 +209,24 @@
</CustomBuild> </CustomBuild>
<ClInclude Include="..\alethzero\Grapher.h" /> <ClInclude Include="..\alethzero\Grapher.h" />
<ClInclude Include="..\alethzero\GraphParameters.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"> <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> <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 Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
@ -289,4 +307,4 @@
</ItemGroup> </ItemGroup>
<Copy SourceFiles="@(CopyToBinDir)" DestinationFiles="@(CopyToBinDir->'..\..\_binaries\$(Platform)\%(RecursiveDir)%(Filename)%(Extension)')" /> <Copy SourceFiles="@(CopyToBinDir)" DestinationFiles="@(CopyToBinDir->'..\..\_binaries\$(Platform)\%(RecursiveDir)%(Filename)%(Extension)')" />
</Target> </Target>
</Project> </Project>

2
windows/Ethereum.sln

@ -23,8 +23,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LibMiniUPnPc", "LibMiniUPnP
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AlethZero", "Alethzero.vcxproj", "{BFCFFC46-78A3-4350-9938-0EA3A2B1CCCD}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AlethZero", "Alethzero.vcxproj", "{BFCFFC46-78A3-4350-9938-0EA3A2B1CCCD}"
EndProject 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}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LibQEthereum", "LibQEthereum.vcxproj", "{DF3C5B07-A1A2-4F16-B37F-A27333622CDD}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "eth", "Eth.vcxproj", "{C60C065C-2135-4B2B-AFD4-35FD7AC56B40}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "eth", "Eth.vcxproj", "{C60C065C-2135-4B2B-AFD4-35FD7AC56B40}"

2
windows/LibEthereum.vcxproj

@ -527,4 +527,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets"> <ImportGroup Label="ExtensionTargets">
</ImportGroup> </ImportGroup>
</Project> </Project>

6
windows/LibEthereum.vcxproj.filters

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

Loading…
Cancel
Save