diff --git a/alephzero/Main.ui b/alephzero/Main.ui index c42e55b9a..de452a125 100644 --- a/alephzero/Main.ui +++ b/alephzero/Main.ui @@ -29,6 +29,25 @@ 0 + + + + + 0 + 0 + + + + UPnP + + + true + + + true + + + diff --git a/alephzero/MainWin.cpp b/alephzero/MainWin.cpp index 20c16d949..56bab0a5f 100644 --- a/alephzero/MainWin.cpp +++ b/alephzero/MainWin.cpp @@ -166,7 +166,7 @@ void Main::refresh() void Main::on_net_toggled() { if (ui->net->isChecked()) - m_client.startNetwork(ui->port->value(), string(), 30303, 6); + m_client.startNetwork(ui->port->value(), string(), 30303, 6, NodeMode::Full, 5, std::string(), ui->upnp->isChecked()); else m_client.stopNetwork(); } diff --git a/alephzero/alephzero.pro b/alephzero/alephzero.pro index afe6d573a..4b58d56ae 100644 --- a/alephzero/alephzero.pro +++ b/alephzero/alephzero.pro @@ -18,14 +18,17 @@ QMAKE_CXXFLAGS += -std=c++11 local_cryptopp { QMAKE_LIBDIR += ../../cryptopp562 - INCLUDE_PATH += ../libethereum - LIBS += -lcryptoppeth + CRYPTOPP_LIBS += -lcryptopp +} + +!local_cryptopp { + CRYPTOPP_LIBS += -lcryptoppeth } INCLUDEPATH += ../../cpp-ethereum -QMAKE_LIBDIR += ../../cpp-ethereum-build/libethereum +QMAKE_LIBDIR += ../../cpp-ethereum-build/libethereum ../../cpp-ethereum-build/secp256k1 CONFIG(debug, debug|release): LIBS += -Wl,-rpath,../../cpp-ethereum-build/libethereum -LIBS += -lethereum -lminiupnpc -lleveldb -lgmp -lboost_filesystem -lboost_system +LIBS += -lethereum $${CRYPTOPP_LIBS} -lsecp256k1 -lminiupnpc -lleveldb -lgmp -lboost_filesystem -lboost_system SOURCES += main.cpp \ MainWin.cpp diff --git a/libethereum/BlockInfo.cpp b/libethereum/BlockInfo.cpp index 60fbc092c..604d64d55 100644 --- a/libethereum/BlockInfo.cpp +++ b/libethereum/BlockInfo.cpp @@ -56,7 +56,7 @@ bytes BlockInfo::createGenesisBlock() clog << db; } - block.appendList(9) << h256() << sha3EmptyList << h160() << stateRoot << sha3EmptyList << c_genesisDifficulty << (uint)0 << string() << (uint)0; + block.appendList(9) << h256() << sha3EmptyList << h160() << stateRoot << sha3EmptyList << c_genesisDifficulty << (uint)0 << string() << (uint)42; block.appendRaw(RLPEmptyList); block.appendRaw(RLPEmptyList); return block.out(); diff --git a/libethereum/PeerNetwork.cpp b/libethereum/PeerNetwork.cpp index 8e92f4383..9c1bc155b 100644 --- a/libethereum/PeerNetwork.cpp +++ b/libethereum/PeerNetwork.cpp @@ -599,8 +599,10 @@ struct UPnP string externalIP() { char addr[16]; - UPNP_GetExternalIPAddress(urls.controlURL, data.first.servicetype, addr); - return addr; + if (!UPNP_GetExternalIPAddress(urls.controlURL, data.first.servicetype, addr)) + return addr; + else + return "0.0.0.0"; } int addRedirect(char const* addr, int port) @@ -742,7 +744,8 @@ void PeerServer::determinePublic(string const& _publicAddress, bool _upnp) p = m_listenPort; } - if (m_upnp->externalIP() == string("0.0.0.0") && _publicAddress.empty()) + auto eip = m_upnp->externalIP(); + if (eip == string("0.0.0.0") && _publicAddress.empty()) m_public = bi::tcp::endpoint(bi::address(), p); else { @@ -762,15 +765,6 @@ void PeerServer::determinePublic(string const& _publicAddress, bool _upnp) m_public = bi::tcp::endpoint(bi::address(), m_listenPort); m_addresses.push_back(m_public.address().to_v4()); } -/* int er; - UPNPDev* dlist = upnpDiscover(250, 0, 0, 0, 0, &er); - for (UPNPDev* d = dlist; d; d = dlist->pNext) - { - IGDdatas data; - parserootdesc(d->descURL, 0, &data); - data.presentationurl() - } - freeUPNPDevlist(dlist);*/ } void PeerServer::populateAddresses() diff --git a/libethereum/State.cpp b/libethereum/State.cpp index 00d2f33e8..b91aae95b 100644 --- a/libethereum/State.cpp +++ b/libethereum/State.cpp @@ -67,6 +67,7 @@ std::map const& eth::genesisState() // Initialise. s_ret[Address(fromUserHex("812413ae7e515a3bcaf7b3444116527bce958c02"))] = AddressState(u256(1) << 200, 0); s_ret[Address(fromUserHex("93658b04240e4bd4046fd2d6d417d20f146f4b43"))] = AddressState(u256(1) << 200, 0); + s_ret[Address(fromUserHex("1e12515ce3e0f817a4ddef9ca55788a1d66bd2df"))] = AddressState(u256(1) << 200, 0); } return s_ret; } @@ -96,12 +97,13 @@ State::State(Address _coinbaseAddress, Overlay const& _db): m_db(_db), m_state(& cout << "State::State: state root initialised to " << m_state.root() << endl; m_previousBlock = BlockInfo::genesis(); - cnote << "Genesis headerhash-nononce:" << m_previousBlock.headerHashWithoutNonce(); + cnote << "Genesis hash:" << m_previousBlock.hash; { RLPStream s; - m_previousBlock.fillStream(s, false); + m_previousBlock.fillStream(s, true); cnote << RLP(s.out()); cnote << asHex(s.out()); + cnote << sha3(s.out()); } resetCurrent();