Browse Source

Improvement to AZ - confirmation disabler.

Fix network crash.
cl-refactor
Gav Wood 10 years ago
parent
commit
1fce862e1b
  1. 12
      alethzero/Main.ui
  2. 9
      alethzero/MainWin.cpp
  3. 1
      alethzero/MainWin.h
  4. 6
      alethzero/OurWebThreeStubServer.cpp
  5. 4
      eth/main.cpp
  6. 2
      libjsqrc/ethereumjs/dist/ethereum.js
  7. 2
      libjsqrc/ethereumjs/dist/ethereum.js.map
  8. 2
      libjsqrc/ethereumjs/dist/ethereum.min.js
  9. 2
      libjsqrc/ethereumjs/lib/httpsync.js
  10. 3
      libp2p/Host.cpp
  11. 2
      mix/qml/js/ProjectModel.js
  12. 1
      standard.js

12
alethzero/Main.ui

@ -163,6 +163,7 @@
<property name="title">
<string>&amp;Special</string>
</property>
<addaction name="natSpec"/>
<addaction name="paranoia"/>
<addaction name="clearPending"/>
<addaction name="killBlockchain"/>
@ -1652,6 +1653,17 @@ font-size: 14pt</string>
<string>New &amp;Transaction...</string>
</property>
</action>
<action name="natSpec">
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="text">
<string>&amp;NatSpec Enabled</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>

9
alethzero/MainWin.cpp

@ -201,6 +201,11 @@ Main::~Main()
g_logPost = simpleDebugOut;
}
bool Main::confirm() const
{
return ui->natSpec->isChecked();
}
void Main::on_newIdentity_triggered()
{
KeyPair kp = KeyPair::create();
@ -651,6 +656,7 @@ void Main::writeSettings()
s.setValue("localNetworking", ui->localNetworking->isChecked());
s.setValue("forceMining", ui->forceMining->isChecked());
s.setValue("paranoia", ui->paranoia->isChecked());
s.setValue("natSpec", ui->natSpec->isChecked());
s.setValue("showAll", ui->showAll->isChecked());
s.setValue("showAllAccounts", ui->showAllAccounts->isChecked());
s.setValue("clientName", ui->clientName->text());
@ -662,7 +668,7 @@ void Main::writeSettings()
s.setValue("jitvm", ui->jitvm->isChecked());
bytes d = m_webThree->saveNetwork();
if (d.size())
if (!d.empty())
m_networkConfig = QByteArray((char*)d.data(), (int)d.size());
s.setValue("peers", m_networkConfig);
s.setValue("nameReg", ui->nameReg->text());
@ -720,6 +726,7 @@ void Main::readSettings(bool _skipGeometry)
ui->forceMining->setChecked(s.value("forceMining", false).toBool());
on_forceMining_triggered();
ui->paranoia->setChecked(s.value("paranoia", false).toBool());
ui->natSpec->setChecked(s.value("natSpec", true).toBool());
ui->showAll->setChecked(s.value("showAll", false).toBool());
ui->showAllAccounts->setChecked(s.value("showAllAccounts", false).toBool());
ui->clientName->setText(s.value("clientName", "").toString());

1
alethzero/MainWin.h

@ -72,6 +72,7 @@ public:
dev::eth::Client* ethereum() const { return m_webThree->ethereum(); }
std::shared_ptr<dev::shh::WhisperHost> whisper() const { return m_webThree->whisper(); }
bool confirm() const;
NatSpecFace* natSpec() { return &m_natSpecDB; }
QVariant evalRaw(QString const& _js);

6
alethzero/OurWebThreeStubServer.cpp

@ -46,6 +46,12 @@ string OurWebThreeStubServer::shh_newIdentity()
bool OurWebThreeStubServer::showAuthenticationPopup(string const& _title, string const& _text) const
{
if (!m_main->confirm())
{
cnote << "Skipping confirmation step for: " << _title << "\n" << _text;
return true;
}
int button;
QMetaObject::invokeMethod(m_main, "authenticate", Qt::BlockingQueuedConnection, Q_RETURN_ARG(int, button), Q_ARG(QString, QString::fromStdString(_title)), Q_ARG(QString, QString::fromStdString(_text)));
return button == QMessageBox::Ok;

4
eth/main.cpp

@ -898,7 +898,9 @@ int main(int argc, char** argv)
while (!g_exit)
this_thread::sleep_for(chrono::milliseconds(1000));
writeFile((dbPath.size() ? dbPath : getDataDir()) + "/network.rlp", web3.saveNetwork());
auto netData = web3.saveNetwork();
if (!netData.empty())
writeFile((dbPath.size() ? dbPath : getDataDir()) + "/network.rlp", netData);
return 0;
}

2
libjsqrc/ethereumjs/dist/ethereum.js

@ -1052,7 +1052,7 @@ if ("build" !== 'build') {/*
var HttpSyncProvider = function (host) {
this.handlers = [];
this.host = host || 'http://localhost:8080';
this.host = host || 'http://127.0.0.1:8080';
};
HttpSyncProvider.prototype.send = function (payload) {

2
libjsqrc/ethereumjs/dist/ethereum.js.map

File diff suppressed because one or more lines are too long

2
libjsqrc/ethereumjs/dist/ethereum.min.js

File diff suppressed because one or more lines are too long

2
libjsqrc/ethereumjs/lib/httpsync.js

@ -27,7 +27,7 @@ if (process.env.NODE_ENV !== 'build') {
var HttpSyncProvider = function (host) {
this.handlers = [];
this.host = host || 'http://localhost:8080';
this.host = host || 'http://127.0.0.1:8080';
};
HttpSyncProvider.prototype.send = function (payload) {

3
libp2p/Host.cpp

@ -630,6 +630,9 @@ void Host::disconnectLatePeers()
bytes Host::saveNetwork() const
{
if (!m_nodeTable)
return bytes();
std::list<Peer> peers;
{
RecursiveGuard l(x_sessions);

2
mix/qml/js/ProjectModel.js

@ -282,7 +282,7 @@ function deployProject(force) {
var date = new Date();
var deploymentId = date.toLocaleString(Qt.locale(), "ddMMyyHHmmsszzz");
var jsonRpcUrl = "http://localhost:8080";
var jsonRpcUrl = "http://127.0.0.1:8080";
console.log("Deploying " + deploymentId + " to " + jsonRpcUrl);
deploymentStarted();

1
standard.js

@ -10,6 +10,7 @@ var addrNameReg = initService("namereg");
var addrGavsino = initServiceVal("gavmble", "1000000000000000000");
var addrCoinReg = initService("coins");
var addrGavCoin = initService("coin");
var addrRegistrar = initService("registrar");
var abiNameReg = [{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"getName","outputs":[{"name":"o_name","type":"string32"}]},{"constant":false,"inputs":[{"name":"name","type":"string32"}],"name":"register","outputs":[]},{"constant":true,"inputs":[{"name":"name","type":"string32"}],"name":"addressOf","outputs":[{"name":"addr","type":"address"}]},{"constant":true,"inputs":[{"name":"_name","type":"string32"}],"name":"getAddress","outputs":[{"name":"o_owner","type":"address"}]},{"constant":false,"inputs":[],"name":"unregister","outputs":[]},{"constant":true,"inputs":[{"name":"addr","type":"address"}],"name":"nameOf","outputs":[{"name":"name","type":"string32"}]}];

Loading…
Cancel
Save