diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index 6aaf6fc18..66fa00b36 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -290,11 +290,8 @@ void Main::installBalancesWatch() for (unsigned i = 0; i < ethereum()->stateAt(coinsAddr, 0); ++i) altCoins.push_back(right160(ethereum()->stateAt(coinsAddr, i + 1))); for (auto i: m_myKeys) - { - tf.address(i.address()); for (auto c: altCoins) - tf.address(c); - } + tf.address(c).topic(h256(i.address(), h256::AlignRight)); uninstallWatch(m_balancesFilter); m_balancesFilter = installWatch(tf, [=](){ onBalancesChange(); }); diff --git a/libethereum/Client.cpp b/libethereum/Client.cpp index 79001d2fb..6405134c7 100644 --- a/libethereum/Client.cpp +++ b/libethereum/Client.cpp @@ -604,30 +604,37 @@ LogEntries Client::logs(LogFilter const& _f) const #if ETH_DEBUG int total = 0; #endif - //? check block bloom - for (TransactionReceipt receipt: m_bc.receipts(h).receipts) - if (_f.matches(receipt.bloom())) + // check block bloom + if (_f.matches(m_bc.info(h).logBloom)) + for (TransactionReceipt receipt: m_bc.receipts(h).receipts) { - LogEntries le = _f.matches(receipt); - if (le.size()) + if (_f.matches(receipt.bloom())) { + LogEntries le = _f.matches(receipt); + if (le.size()) + { #if ETH_DEBUG - total += le.size(); + total += le.size(); #endif - for (unsigned j = 0; j < le.size() && ret.size() != m; ++j) - { - if (s) - s--; - else - ret.insert(ret.begin(), le[j]); + for (unsigned j = 0; j < le.size() && ret.size() != m; ++j) + { + if (s) + s--; + else + ret.insert(ret.begin(), le[j]); + } } } + if (!total) + falsePos++; } + else + skipped++; if (n == end) break; } #if ETH_DEBUG -// cdebug << (begin - n) << "searched; " << skipped << "skipped; " << falsePos << "false +ves"; + cdebug << (begin - n) << "searched; " << skipped << "skipped; " << falsePos << "false +ves"; #endif return ret; } diff --git a/libethereum/MessageFilter.h b/libethereum/MessageFilter.h index 5602d7a17..482c68ef6 100644 --- a/libethereum/MessageFilter.h +++ b/libethereum/MessageFilter.h @@ -90,7 +90,6 @@ public: LogEntries matches(TransactionReceipt const& _r) const; LogFilter address(Address _a) { m_addresses.insert(_a); return *this; } - LogFilter from(Address _a) { return topic(u256((u160)_a) + 1); } LogFilter topic(h256 const& _t) { m_topics.insert(_t); return *this; } LogFilter withMax(unsigned _m) { m_max = _m; return *this; } LogFilter withSkip(unsigned _m) { m_skip = _m; return *this; } diff --git a/libethereum/State.cpp b/libethereum/State.cpp index a37c26645..34d9eae99 100644 --- a/libethereum/State.cpp +++ b/libethereum/State.cpp @@ -802,7 +802,7 @@ void State::commitToMine(BlockChain const& _bc) { uncommitToMine(); - cnote << "Committing to mine on block" << m_previousBlock.hash.abridged(); +// cnote << "Committing to mine on block" << m_previousBlock.hash.abridged(); #ifdef ETH_PARANOIA commit(); cnote << "Pre-reward stateRoot:" << m_state.root(); @@ -877,7 +877,7 @@ void State::commitToMine(BlockChain const& _bc) // Commit any and all changes to the trie that are in the cache, then update the state root accordingly. commit(); - cnote << "Post-reward stateRoot:" << m_state.root().abridged(); +// cnote << "Post-reward stateRoot:" << m_state.root().abridged(); // cnote << m_state; // cnote << *this; diff --git a/libweb3jsonrpc/WebThreeStubServer.cpp b/libweb3jsonrpc/WebThreeStubServer.cpp index 2676913e5..6589c9068 100644 --- a/libweb3jsonrpc/WebThreeStubServer.cpp +++ b/libweb3jsonrpc/WebThreeStubServer.cpp @@ -113,17 +113,6 @@ static dev::eth::LogFilter toLogFilter(Json::Value const& _json) // commented to filter.withMax(_json["max"].asInt()); if (_json["skip"].isInt()) filter.withSkip(_json["skip"].asInt()); - if (!_json["from"].empty()) - { - if (_json["from"].isArray()) - { - for (auto i : _json["from"]) - if (i.isString()) - filter.from(jsToAddress(i.asString())); - } - else if (_json["from"].isString()) - filter.from(jsToAddress(_json["from"].asString())); - } if (!_json["address"].empty()) { if (_json["address"].isArray()) @@ -133,7 +122,7 @@ static dev::eth::LogFilter toLogFilter(Json::Value const& _json) // commented to filter.address(jsToAddress(i.asString())); } else if (_json["address"].isString()) - filter.from(jsToAddress(_json["address"].asString())); + filter.address(jsToAddress(_json["address"].asString())); } if (!_json["topics"].empty()) {