Browse Source

Mix fix for previous commit.

cl-refactor
Gav Wood 10 years ago
parent
commit
1e0201142f
  1. 10
      mix/MixClient.cpp
  2. 4
      mix/MixClient.h

10
mix/MixClient.cpp

@ -40,6 +40,8 @@ namespace dev
namespace mix 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 Secret c_defaultUserAccountSecret = Secret("cb73d9408c4720e230387d956eb0f829d8a4dd2c1055f96257167e14e7169074");
const u256 c_mixGenesisDifficulty = c_minimumDifficulty; //TODO: make it lower for Mix somehow 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; return ret;
} }
unsigned MixClient::installWatch(h256 _h) unsigned MixClient::installWatch(h256 _h, eth::Reaping _r)
{ {
unsigned ret; unsigned ret;
{ {
Guard l(m_filterLock); Guard l(m_filterLock);
ret = m_watches.size() ? m_watches.rbegin()->first + 1 : 0; 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); auto ch = logs(ret);
if (ch.empty()) if (ch.empty())
@ -378,14 +380,14 @@ unsigned MixClient::installWatch(h256 _h)
return ret; return ret;
} }
unsigned MixClient::installWatch(eth::LogFilter const& _f) unsigned MixClient::installWatch(eth::LogFilter const& _f, eth::Reaping _r)
{ {
h256 h = _f.sha3(); h256 h = _f.sha3();
{ {
Guard l(m_filterLock); Guard l(m_filterLock);
m_filters.insert(std::make_pair(h, _f)); m_filters.insert(std::make_pair(h, _f));
} }
return installWatch(h); return installWatch(h, _r);
} }
bool MixClient::uninstallWatch(unsigned _i) bool MixClient::uninstallWatch(unsigned _i)

4
mix/MixClient.h

@ -60,8 +60,8 @@ public:
std::map<u256, u256> storageAt(Address _a, int _block) const override; std::map<u256, u256> storageAt(Address _a, int _block) const override;
eth::LocalisedLogEntries logs(unsigned _watchId) const override; eth::LocalisedLogEntries logs(unsigned _watchId) const override;
eth::LocalisedLogEntries logs(eth::LogFilter const& _filter) const override; eth::LocalisedLogEntries logs(eth::LogFilter const& _filter) const override;
unsigned installWatch(eth::LogFilter const& _filter) override; unsigned installWatch(eth::LogFilter const& _filter, eth::Reaping _r = eth::Reaping::Automatic) override;
unsigned installWatch(h256 _filterId) override; unsigned installWatch(h256 _filterId, eth::Reaping _r = eth::Reaping::Automatic) override;
bool uninstallWatch(unsigned _watchId) override; bool uninstallWatch(unsigned _watchId) override;
eth::LocalisedLogEntries peekWatch(unsigned _watchId) const override; eth::LocalisedLogEntries peekWatch(unsigned _watchId) const override;
eth::LocalisedLogEntries checkWatch(unsigned _watchId) override; eth::LocalisedLogEntries checkWatch(unsigned _watchId) override;

Loading…
Cancel
Save