From 1e0201142f1e581a0d1c616f98091cc2e12dc85e Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Sat, 14 Mar 2015 20:15:15 +0100 Subject: [PATCH] Mix fix for previous commit. --- mix/MixClient.cpp | 10 ++++++---- mix/MixClient.h | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/mix/MixClient.cpp b/mix/MixClient.cpp index a8619f843..e088a093b 100644 --- a/mix/MixClient.cpp +++ b/mix/MixClient.cpp @@ -40,6 +40,8 @@ namespace dev namespace mix { +// TODO: merge as much as possible with the Client.cpp into a mutually inherited base class. + const Secret c_defaultUserAccountSecret = Secret("cb73d9408c4720e230387d956eb0f829d8a4dd2c1055f96257167e14e7169074"); const u256 c_mixGenesisDifficulty = c_minimumDifficulty; //TODO: make it lower for Mix somehow @@ -360,13 +362,13 @@ eth::LocalisedLogEntries MixClient::logs(eth::LogFilter const& _f) const return ret; } -unsigned MixClient::installWatch(h256 _h) +unsigned MixClient::installWatch(h256 _h, eth::Reaping _r) { unsigned ret; { Guard l(m_filterLock); ret = m_watches.size() ? m_watches.rbegin()->first + 1 : 0; - m_watches[ret] = ClientWatch(_h); + m_watches[ret] = ClientWatch(_h, _r); } auto ch = logs(ret); if (ch.empty()) @@ -378,14 +380,14 @@ unsigned MixClient::installWatch(h256 _h) return ret; } -unsigned MixClient::installWatch(eth::LogFilter const& _f) +unsigned MixClient::installWatch(eth::LogFilter const& _f, eth::Reaping _r) { h256 h = _f.sha3(); { Guard l(m_filterLock); m_filters.insert(std::make_pair(h, _f)); } - return installWatch(h); + return installWatch(h, _r); } bool MixClient::uninstallWatch(unsigned _i) diff --git a/mix/MixClient.h b/mix/MixClient.h index ff85d6458..af5c8ec2b 100644 --- a/mix/MixClient.h +++ b/mix/MixClient.h @@ -60,8 +60,8 @@ public: std::map storageAt(Address _a, int _block) const override; eth::LocalisedLogEntries logs(unsigned _watchId) const override; eth::LocalisedLogEntries logs(eth::LogFilter const& _filter) const override; - unsigned installWatch(eth::LogFilter const& _filter) override; - unsigned installWatch(h256 _filterId) override; + unsigned installWatch(eth::LogFilter const& _filter, eth::Reaping _r = eth::Reaping::Automatic) override; + unsigned installWatch(h256 _filterId, eth::Reaping _r = eth::Reaping::Automatic) override; bool uninstallWatch(unsigned _watchId) override; eth::LocalisedLogEntries peekWatch(unsigned _watchId) const override; eth::LocalisedLogEntries checkWatch(unsigned _watchId) override;