diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp
index 460669cf9..6aaf6fc18 100644
--- a/alethzero/MainWin.cpp
+++ b/alethzero/MainWin.cpp
@@ -1292,7 +1292,7 @@ void Main::on_blocks_currentItemChanged()
Transaction tx(block[1][txi].data());
auto ss = tx.safeSender();
h256 th = sha3(rlpList(ss, tx.nonce()));
- auto receipt = ethereum()->blockChain().receipts(h).receipts[txi];
+ TransactionReceipt receipt = ethereum()->blockChain().receipts(h).receipts[txi];
s << "
" << th << "
";
s << "" << h << "[" << txi << "]
";
s << "
From: " << pretty(ss).toHtmlEscaped().toStdString() << " " << ss;
@@ -1308,6 +1308,7 @@ void Main::on_blocks_currentItemChanged()
s << "
R: " << hex << nouppercase << tx.signature().r << "";
s << "
S: " << hex << nouppercase << tx.signature().s << "";
s << "
Msg: " << tx.sha3(eth::WithoutSignature) << "";
+ s << "Log Bloom: " << receipt.bloom() << "
";
s << "Hex: " << toHex(block[1][txi].data()) << "
";
auto r = receipt.rlp();
s << "Receipt: " << toString(RLP(r)) << "
";
diff --git a/libethereum/BlockChain.h b/libethereum/BlockChain.h
index 49f7b149e..74d94e164 100644
--- a/libethereum/BlockChain.h
+++ b/libethereum/BlockChain.h
@@ -93,6 +93,10 @@ public:
/// Returns true if the given block is known (though not necessarily a part of the canon chain).
bool isKnown(h256 _hash) const;
+ /// Get the familial details concerning a block (or the most recent mined if none given). Thread-safe.
+ BlockInfo info(h256 _hash) const { return BlockInfo(block(_hash)); }
+ BlockInfo info() const { return BlockInfo(block()); }
+
/// Get the familial details concerning a block (or the most recent mined if none given). Thread-safe.
BlockDetails details(h256 _hash) const { return queryExtras(_hash, m_details, x_details, NullBlockDetails); }
BlockDetails details() const { return details(currentHash()); }
diff --git a/libethereum/Client.cpp b/libethereum/Client.cpp
index 01aa75b9a..79001d2fb 100644
--- a/libethereum/Client.cpp
+++ b/libethereum/Client.cpp
@@ -232,12 +232,12 @@ void Client::appendFromNewPending(LogBloom _bloom, h256Set& o_changed) const
void Client::appendFromNewBlock(h256 _block, h256Set& o_changed) const
{
-// auto d = m_bc.info(_block);
-//
-// lock_guard l(m_filterLock);
-// for (pair const& i: m_filters)
-// if ((unsigned)i.second.filter.latest() >= d.number && (unsigned)i.second.filter.earliest() <= d.number && i.second.filter.matches(d.logBloom))
-// o_changed.insert(i.first);
+ auto d = m_bc.info(_block);
+
+ lock_guard l(m_filterLock);
+ for (pair const& i: m_filters)
+ if ((unsigned)i.second.filter.latest() >= d.number && (unsigned)i.second.filter.earliest() <= d.number && i.second.filter.matches(d.logBloom))
+ o_changed.insert(i.first);
}
void Client::setForceMining(bool _enable)
diff --git a/libjsqrc/ethereum.js b/libjsqrc/ethereum.js
index bd5b4fb4e..43ac12fd8 100644
--- a/libjsqrc/ethereum.js
+++ b/libjsqrc/ethereum.js
@@ -599,7 +599,7 @@ var ethWatchMethods = function () {
return [
{ name: 'newFilter', call: newFilter },
{ name: 'uninstallFilter', call: 'eth_uninstallFilter' },
- { name: 'getMessages', call: 'eth_getMessages' }
+ { name: 'logs', call: 'eth_getMessages' }
];
};
@@ -904,6 +904,8 @@ Filter.prototype.messages = function() {
});
};
+Filter.prototype.logs = Filter.prototype.messages;
+
function messageHandler(data) {
if(data._event !== undefined) {
web3.trigger(data._event, data._id, data.data);
@@ -1060,4 +1062,4 @@ module.exports = web3;
},{"./lib/autoprovider":2,"./lib/contract":3,"./lib/httprpc":4,"./lib/main":5,"./lib/qt":6,"./lib/websocket":7}]},{},[])
-//# sourceMappingURL=ethereum.js.map
\ No newline at end of file
+//# sourceMappingURL=ethereum.js.map
diff --git a/libweb3jsonrpc/WebThreeStubServer.cpp b/libweb3jsonrpc/WebThreeStubServer.cpp
index 6bedfed3f..2676913e5 100644
--- a/libweb3jsonrpc/WebThreeStubServer.cpp
+++ b/libweb3jsonrpc/WebThreeStubServer.cpp
@@ -394,7 +394,7 @@ std::string WebThreeStubServer::db_get(std::string const& _name, std::string con
return toJS(dev::asBytes(ret));
}
-Json::Value WebThreeStubServer::eth_getMessages(int const& _id)
+Json::Value WebThreeStubServer::eth_getLogs(int const& _id)
{
if (!client())
return Json::Value();
diff --git a/libweb3jsonrpc/WebThreeStubServer.h b/libweb3jsonrpc/WebThreeStubServer.h
index 7d25f5954..007c06cb8 100644
--- a/libweb3jsonrpc/WebThreeStubServer.h
+++ b/libweb3jsonrpc/WebThreeStubServer.h
@@ -76,7 +76,7 @@ public:
virtual double eth_countAt(std::string const& _address);
virtual int eth_defaultBlock();
virtual std::string eth_gasPrice();
- virtual Json::Value eth_getMessages(int const& _id);
+ virtual Json::Value eth_getLogs(int const& _id);
virtual bool eth_listening();
virtual bool eth_mining();
virtual int eth_newFilter(Json::Value const& _json);
diff --git a/libweb3jsonrpc/abstractwebthreestubserver.h b/libweb3jsonrpc/abstractwebthreestubserver.h
index b86576572..fd3f8b051 100644
--- a/libweb3jsonrpc/abstractwebthreestubserver.h
+++ b/libweb3jsonrpc/abstractwebthreestubserver.h
@@ -29,7 +29,7 @@ class AbstractWebThreeStubServer : public jsonrpc::AbstractServerbindAndAddMethod(new jsonrpc::Procedure("eth_countAt", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_REAL, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_countAtI);
this->bindAndAddMethod(new jsonrpc::Procedure("eth_defaultBlock", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_defaultBlockI);
this->bindAndAddMethod(new jsonrpc::Procedure("eth_gasPrice", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_gasPriceI);
- this->bindAndAddMethod(new jsonrpc::Procedure("eth_getMessages", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_ARRAY, "param1",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_getMessagesI);
+ this->bindAndAddMethod(new jsonrpc::Procedure("eth_getLogs", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_ARRAY, "param1",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_getLogsI);
this->bindAndAddMethod(new jsonrpc::Procedure("eth_listening", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, NULL), &AbstractWebThreeStubServer::eth_listeningI);
this->bindAndAddMethod(new jsonrpc::Procedure("eth_lll", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_lllI);
this->bindAndAddMethod(new jsonrpc::Procedure("eth_mining", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, NULL), &AbstractWebThreeStubServer::eth_miningI);
@@ -142,9 +142,9 @@ class AbstractWebThreeStubServer : public jsonrpc::AbstractServereth_gasPrice();
}
- inline virtual void eth_getMessagesI(const Json::Value& request, Json::Value& response)
+ inline virtual void eth_getLogsI(const Json::Value& request, Json::Value& response)
{
- response = this->eth_getMessages(request[0u].asInt());
+ response = this->eth_getLogs(request[0u].asInt());
}
inline virtual void eth_listeningI(const Json::Value& request, Json::Value& response)
@@ -309,7 +309,7 @@ class AbstractWebThreeStubServer : public jsonrpc::AbstractServerclient->CallMethod("eth_getMessages",p);
+ Json::Value result = this->client->CallMethod("eth_getLogs",p);
if (result.isArray())
return result;
else
diff --git a/third/MainWin.cpp b/third/MainWin.cpp
index c2dcb7ce2..299aafaaa 100644
--- a/third/MainWin.cpp
+++ b/third/MainWin.cpp
@@ -182,7 +182,7 @@ void Main::onKeysChanged()
installBalancesWatch();
}
-unsigned Main::installWatch(dev::eth::MessageFilter const& _tf, std::function const& _f)
+unsigned Main::installWatch(dev::eth::LogFilter const& _tf, std::function const& _f)
{
auto ret = ethereum()->installWatch(_tf);
m_handlers[ret] = _f;
@@ -198,37 +198,34 @@ unsigned Main::installWatch(dev::h256 _tf, std::function const& _f)
void Main::installWatches()
{
- installWatch(dev::eth::MessageFilter().altered(c_config, 0), [=](){ installNameRegWatch(); });
- installWatch(dev::eth::MessageFilter().altered(c_config, 1), [=](){ installCurrenciesWatch(); });
+ installWatch(dev::eth::LogFilter().topic((u256)(u160)c_config).topic((u256)0), [=](){ installNameRegWatch(); });
+ installWatch(dev::eth::LogFilter().topic((u256)(u160)c_config).topic((u256)1), [=](){ installCurrenciesWatch(); });
installWatch(dev::eth::ChainChangedFilter, [=](){ onNewBlock(); });
}
void Main::installNameRegWatch()
{
ethereum()->uninstallWatch(m_nameRegFilter);
- m_nameRegFilter = installWatch(dev::eth::MessageFilter().altered((u160)ethereum()->stateAt(c_config, 0)), [=](){ onNameRegChange(); });
+ m_nameRegFilter = installWatch(dev::eth::LogFilter().topic(ethereum()->stateAt(c_config, 0)), [=](){ onNameRegChange(); });
}
void Main::installCurrenciesWatch()
{
ethereum()->uninstallWatch(m_currenciesFilter);
- m_currenciesFilter = installWatch(dev::eth::MessageFilter().altered((u160)ethereum()->stateAt(c_config, 1)), [=](){ onCurrenciesChange(); });
+ m_currenciesFilter = installWatch(dev::eth::LogFilter().topic(ethereum()->stateAt(c_config, 1)), [=](){ onCurrenciesChange(); });
}
void Main::installBalancesWatch()
{
- dev::eth::MessageFilter tf;
+ dev::eth::LogFilter tf;
vector altCoins;
Address coinsAddr = right160(ethereum()->stateAt(c_config, 1));
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.altered(i.address());
for (auto c: altCoins)
- tf.altered(c, (u160)i.address());
- }
+ tf.address(c).topic((u256)(u160)i.address());
ethereum()->uninstallWatch(m_balancesFilter);
m_balancesFilter = installWatch(tf, [=](){ onBalancesChange(); });
diff --git a/third/MainWin.h b/third/MainWin.h
index 607d65fee..478fb6fb6 100644
--- a/third/MainWin.h
+++ b/third/MainWin.h
@@ -40,7 +40,7 @@ namespace dev { class WebThreeDirect;
namespace eth {
class Client;
class State;
-class MessageFilter;
+class LogFilter;
}
namespace shh {
class WhisperHost;
@@ -95,7 +95,7 @@ private:
void readSettings(bool _skipGeometry = false);
void writeSettings();
- unsigned installWatch(dev::eth::MessageFilter const& _tf, std::function const& _f);
+ unsigned installWatch(dev::eth::LogFilter const& _tf, std::function const& _f);
unsigned installWatch(dev::h256 _tf, std::function const& _f);
void onNewBlock();