diff --git a/libethereum/EthereumHost.cpp b/libethereum/EthereumHost.cpp index de0e991e6..e7e80c28a 100644 --- a/libethereum/EthereumHost.cpp +++ b/libethereum/EthereumHost.cpp @@ -74,12 +74,19 @@ void EthereumHost::noteHavePeerState(EthereumPeer* _who) { clog(NetAllDetail) << "Have peer state."; + // TODO: FIX: BUG: Better state management! + // if already downloading hash-chain, ignore. if (m_grabbing != Grabbing::Nothing) { - clog(NetAllDetail) << "Already downloading chain. Just set to help out."; - _who->ensureGettingChain(); - return; + for (auto const& i: peers()) + if (i->cap()->m_grabbing == m_grabbing || m_grabbing == Grabbing::State) + { + clog(NetAllDetail) << "Already downloading chain. Just set to help out."; + _who->ensureGettingChain(); + return; + } + m_grabbing = Grabbing::Nothing; } // otherwise check to see if we should be downloading... diff --git a/libethereum/State.cpp b/libethereum/State.cpp index 362e2c94c..1dfa7aeef 100644 --- a/libethereum/State.cpp +++ b/libethereum/State.cpp @@ -966,7 +966,7 @@ bool State::isTrieGood(bool _enforceRefs, bool _requireNoLeftOvers) const RLP r(i.second); TrieDB storageDB(const_cast(&m_db), r[2].toHash()); // promise not to alter OverlayDB. for (auto const& j: storageDB) { (void)j; } - if (!e && r[3].toHash() != EmptySHA3 && m_db.lookup(r[3].toHash()).empty()) + if (!e && r[3].toHash() && m_db.lookup(r[3].toHash()).empty()) return false; } } diff --git a/libwhisper/WhisperPeer.cpp b/libwhisper/WhisperPeer.cpp index 4baccdf9c..e92e2cac3 100644 --- a/libwhisper/WhisperPeer.cpp +++ b/libwhisper/WhisperPeer.cpp @@ -92,15 +92,17 @@ void WhisperPeer::sendMessages() n++; } - // pause before sending if no messages to send - if (!n) + if (n) + { + RLPStream s; + prep(s); + s.appendList(n + 1) << MessagesPacket; + s.appendRaw(amalg.out(), n); + sealAndSend(s); + } + else + // just pause if no messages to send this_thread::sleep_for(chrono::milliseconds(100)); - - RLPStream s; - prep(s); - s.appendList(n + 1) << MessagesPacket; - s.appendRaw(amalg.out(), n); - sealAndSend(s); } void WhisperPeer::noteNewMessage(h256 _h, Message const& _m) diff --git a/windows/LibCryptoPP.vcxproj b/windows/LibCryptoPP.vcxproj index 51e509a45..032ae5fa6 100644 --- a/windows/LibCryptoPP.vcxproj +++ b/windows/LibCryptoPP.vcxproj @@ -19,35 +19,275 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +