diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index 26d91d2cb..cee59e32f 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -153,14 +153,14 @@ Main::Main(QWidget *parent) : m_server = unique_ptr(new WebThreeStubServer(m_qwebConnector, *web3(), keysAsVector(m_myKeys))); m_server->setIdentities(keysAsVector(owned())); m_server->StartListening(); - + connect(ui->webView, &QWebView::loadStarted, [this]() { // NOTE: no need to delete as QETH_INSTALL_JS_NAMESPACE adopts it. m_qweb = new QWebThree(this); auto qweb = m_qweb; m_qwebConnector->setQWeb(qweb); - + QWebSettings::globalSettings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true); QWebFrame* f = ui->webView->page()->mainFrame(); f->disconnect(SIGNAL(javaScriptWindowObjectCleared())); @@ -179,9 +179,7 @@ Main::Main(QWidget *parent) : }); readSettings(); - installWatches(); - startTimer(100); { diff --git a/eth/main.cpp b/eth/main.cpp index cd2622ca8..759dd40d0 100644 --- a/eth/main.cpp +++ b/eth/main.cpp @@ -341,6 +341,7 @@ int main(int argc, char** argv) if (jsonrpc > -1) { jsonrpcServer = auto_ptr(new WebThreeStubServer(new jsonrpc::CorsHttpServer(jsonrpc), web3, {us})); + jsonrpcServer->setIdentities({us}); jsonrpcServer->StartListening(); } #endif @@ -428,6 +429,7 @@ int main(int argc, char** argv) if (jsonrpc < 0) jsonrpc = 8080; jsonrpcServer = auto_ptr(new WebThreeStubServer(new jsonrpc::CorsHttpServer(jsonrpc), web3, {us})); + jsonrpcServer->setIdentities({us}); jsonrpcServer->StartListening(); } else if (cmd == "jsonstop") diff --git a/libweb3jsonrpc/WebThreeStubServer.cpp b/libweb3jsonrpc/WebThreeStubServer.cpp index 74deb87c7..0db178dfe 100644 --- a/libweb3jsonrpc/WebThreeStubServer.cpp +++ b/libweb3jsonrpc/WebThreeStubServer.cpp @@ -463,6 +463,7 @@ std::string WebThreeStubServer::newGroup(std::string const& _id, std::string con std::string WebThreeStubServer::newIdentity() { KeyPair kp = KeyPair::create(); + m_ids[kp.pub()] = kp.secret(); return toJS(kp.pub()); } diff --git a/neth/main.cpp b/neth/main.cpp index 430694156..4e3a0f40a 100644 --- a/neth/main.cpp +++ b/neth/main.cpp @@ -479,6 +479,7 @@ int main(int argc, char** argv) if (jsonrpc > -1) { jsonrpcServer = auto_ptr(new WebThreeStubServer(new jsonrpc::HttpServer(jsonrpc), web3, {us})); + jsonrpcServer->setIdentities({us}); jsonrpcServer->StartListening(); } #endif @@ -552,6 +553,7 @@ int main(int argc, char** argv) if (jsonrpc < 0) jsonrpc = 8080; jsonrpcServer = auto_ptr(new WebThreeStubServer(new jsonrpc::HttpServer(jsonrpc), web3, {us})); + jsonrpcServer->setIdentities({us}); jsonrpcServer->StartListening(); } else if (cmd == "jsonstop") diff --git a/test/jsonrpc.cpp b/test/jsonrpc.cpp index 1751b6c53..ae8c08a71 100644 --- a/test/jsonrpc.cpp +++ b/test/jsonrpc.cpp @@ -61,6 +61,7 @@ struct JsonrpcFixture { web3.setIdealPeerCount(5); web3.ethereum()->setForceMining(true); jsonrpcServer = unique_ptr(new WebThreeStubServer(new jsonrpc::CorsHttpServer(8080), web3, {})); + jsonrpcServer->setIdentities({}); jsonrpcServer->StartListening(); jsonrpcClient = unique_ptr(new WebThreeStubClient(new jsonrpc::HttpClient("http://localhost:8080"))); diff --git a/third/MainWin.cpp b/third/MainWin.cpp index 9bd788c16..d2d5c0874 100644 --- a/third/MainWin.cpp +++ b/third/MainWin.cpp @@ -118,7 +118,8 @@ Main::Main(QWidget *parent) : m_web3->connect(Host::pocHost()); m_qwebConnector = new QWebThreeConnector(); - m_server = unique_ptr(new WebThreeStubServer(m_qwebConnector, *web3(), keysAsVector(owned()))); + m_server = unique_ptr(new WebThreeStubServer(m_qwebConnector, *web3(), keysAsVector(m_myKeys))); + m_server->setIdentities(keysAsVector(owned())); m_server->StartListening(); connect(ui->webView, &QWebView::loadStarted, [this]() @@ -557,7 +558,7 @@ void Main::ourAccountsRowsMoved() m_myKeys = myKeys; if (m_server.get()) - m_server->setAccounts(keysAsVector(owned())); + m_server->setAccounts(keysAsVector(myKeys)); } void Main::on_ourAccounts_doubleClicked() diff --git a/third/MainWin.h b/third/MainWin.h index 1f30a60eb..535ad88a1 100644 --- a/third/MainWin.h +++ b/third/MainWin.h @@ -62,7 +62,7 @@ public: dev::eth::Client* ethereum() const; std::shared_ptr whisper() const; - QList const& owned() const { return m_myKeys; } + QList owned() const { return m_myKeys + m_myIdentities;} public slots: void note(QString _entry); @@ -122,6 +122,7 @@ private: std::unique_ptr m_web3; QList m_myKeys; + QList m_myIdentities; std::map> m_handlers; unsigned m_nameRegFilter = (unsigned)-1;