Browse Source

fix for eth_changed

cl-refactor
Marek Kotewicz 10 years ago
parent
commit
81dbf3ec5f
  1. 24
      libqethereum/QEthereum.cpp

24
libqethereum/QEthereum.cpp

@ -134,34 +134,22 @@ void QWebThree::onDataProcessed(QString _json, QString _addInfo)
if (!_addInfo.compare("internal"))
return;
if (!_addInfo.compare("eth_changed"))
if (!_addInfo.compare("shh_changed") || !_addInfo.compare("eth_changed"))
{
QJsonArray resultsArray = QJsonDocument::fromJson(_json.toUtf8()).array();
for (int i = 0; i < resultsArray.size(); i++)
{
QJsonObject elem = resultsArray[i].toObject();
if (elem.contains("result") && elem["result"].toBool() == true)
if (elem.contains("result"))
{
QJsonObject res;
res["_event"] = _addInfo;
res["_id"] = (int)m_watches[i]; // we can do that couse poll is synchronous
response(QString::fromUtf8(QJsonDocument(res).toJson()));
}
}
return;
}
if (!_addInfo.compare("shh_changed"))
{
QJsonArray resultsArray = QJsonDocument::fromJson(_json.toUtf8()).array();
for (int i = 0; i < resultsArray.size(); i++)
{
QJsonObject elem = resultsArray[i].toObject();
if (elem.contains("result"))
{
QJsonObject res;
res["_event"] = _addInfo;
res["_id"] = (int)m_shhWatches[i];
res["_id"] = (int)m_shhWatches[i]; // we can do that couse poll is synchronous
else
res["_id"] = (int)m_watches[i];
res["data"] = elem["result"].toArray();
response(QString::fromUtf8(QJsonDocument(res).toJson()));
}

Loading…
Cancel
Save