Browse Source

Merge branch 'develop' of github.com:ethereum/cpp-ethereum into develop

cl-refactor
Gav Wood 10 years ago
parent
commit
f4fb1998c2
  1. 2
      libjsqrc/ethereumjs/bower.json
  2. 2
      libjsqrc/ethereumjs/dist/ethereum.js
  3. 2
      libjsqrc/ethereumjs/dist/ethereum.js.map
  4. 2
      libjsqrc/ethereumjs/dist/ethereum.min.js
  5. 2
      libjsqrc/ethereumjs/lib/web3/requestmanager.js
  6. 2
      libjsqrc/ethereumjs/package.js
  7. 2
      libjsqrc/ethereumjs/package.json
  8. 18
      libp2p/NodeTable.cpp
  9. 5
      libp2p/NodeTable.h
  10. 10
      libp2p/RLPxHandshake.cpp
  11. 2
      mix/qml/html/WebContainer.html

2
libjsqrc/ethereumjs/bower.json

@ -1,7 +1,7 @@
{ {
"name": "ethereum.js", "name": "ethereum.js",
"namespace": "ethereum", "namespace": "ethereum",
"version": "0.1.1", "version": "0.1.2",
"description": "Ethereum Compatible JavaScript API", "description": "Ethereum Compatible JavaScript API",
"main": [ "main": [
"./dist/ethereum.js", "./dist/ethereum.js",

2
libjsqrc/ethereumjs/dist/ethereum.js

@ -2656,7 +2656,7 @@ var requestManager = function() {
var poll = function () { var poll = function () {
polls.forEach(function (data) { polls.forEach(function (data) {
// send async // send async
send(data.data, function(result){ send(data.data, function(error, result){
if (!(result instanceof Array) || result.length === 0) { if (!(result instanceof Array) || result.length === 0) {
return; return;
} }

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/web3/requestmanager.js

@ -136,7 +136,7 @@ var requestManager = function() {
var poll = function () { var poll = function () {
polls.forEach(function (data) { polls.forEach(function (data) {
// send async // send async
send(data.data, function(result){ send(data.data, function(error, result){
if (!(result instanceof Array) || result.length === 0) { if (!(result instanceof Array) || result.length === 0) {
return; return;
} }

2
libjsqrc/ethereumjs/package.js

@ -1,7 +1,7 @@
/* jshint ignore:start */ /* jshint ignore:start */
Package.describe({ Package.describe({
name: 'ethereum:js', name: 'ethereum:js',
version: '0.1.1', version: '0.1.2',
summary: 'Ethereum JavaScript API, middleware to talk to a ethreum node over RPC', summary: 'Ethereum JavaScript API, middleware to talk to a ethreum node over RPC',
git: 'https://github.com/ethereum/ethereum.js', git: 'https://github.com/ethereum/ethereum.js',
// By default, Meteor will default to using README.md for documentation. // By default, Meteor will default to using README.md for documentation.

2
libjsqrc/ethereumjs/package.json

@ -1,7 +1,7 @@
{ {
"name": "ethereum.js", "name": "ethereum.js",
"namespace": "ethereum", "namespace": "ethereum",
"version": "0.1.1", "version": "0.1.2",
"description": "Ethereum JavaScript API, middleware to talk to a ethreum node over RPC", "description": "Ethereum JavaScript API, middleware to talk to a ethreum node over RPC",
"main": "./index.js", "main": "./index.js",
"directories": { "directories": {

18
libp2p/NodeTable.cpp

@ -97,7 +97,7 @@ shared_ptr<NodeEntry> NodeTable::addNode(Node const& _node)
m_socketPointer->send(p); m_socketPointer->send(p);
// TODO p2p: rename to p2p.nodes.pending, add p2p.nodes.add event (when pong is received) // TODO p2p: rename to p2p.nodes.pending, add p2p.nodes.add event (when pong is received)
clog(NodeTableNote) << "p2p.nodes.add " << _node.id.abridged(); clog(NodeTableUpdate) << "p2p.nodes.add " << _node.id.abridged();
if (m_nodeEventHandler) if (m_nodeEventHandler)
m_nodeEventHandler->appendEvent(_node.id, NodeEntryAdded); m_nodeEventHandler->appendEvent(_node.id, NodeEntryAdded);
@ -159,7 +159,7 @@ void NodeTable::discover(NodeId _node, unsigned _round, shared_ptr<set<shared_pt
if (_round == s_maxSteps) if (_round == s_maxSteps)
{ {
clog(NodeTableNote) << "Terminating discover after " << _round << " rounds."; clog(NodeTableEvent) << "Terminating discover after " << _round << " rounds.";
return; return;
} }
else if(!_round && !_tried) else if(!_round && !_tried)
@ -180,7 +180,7 @@ void NodeTable::discover(NodeId _node, unsigned _round, shared_ptr<set<shared_pt
if (tried.empty()) if (tried.empty())
{ {
clog(NodeTableNote) << "Terminating discover after " << _round << " rounds."; clog(NodeTableEvent) << "Terminating discover after " << _round << " rounds.";
return; return;
} }
@ -308,7 +308,7 @@ void NodeTable::noteActiveNode(Public const& _pubk, bi::udp::endpoint const& _en
if (_pubk == m_node.address()) if (_pubk == m_node.address())
return; return;
clog(NodeTableNote) << "Noting active node:" << _pubk.abridged() << _endpoint.address().to_string() << ":" << _endpoint.port(); clog(NodeTableConnect) << "Noting active node:" << _pubk.abridged() << _endpoint.address().to_string() << ":" << _endpoint.port();
shared_ptr<NodeEntry> node(addNode(_pubk, _endpoint, bi::tcp::endpoint(_endpoint.address(), _endpoint.port()))); shared_ptr<NodeEntry> node(addNode(_pubk, _endpoint, bi::tcp::endpoint(_endpoint.address(), _endpoint.port())));
@ -361,7 +361,7 @@ void NodeTable::dropNode(shared_ptr<NodeEntry> _n)
m_nodes.erase(_n->id); m_nodes.erase(_n->id);
} }
clog(NodeTableNote) << "p2p.nodes.drop " << _n->id.abridged(); clog(NodeTableUpdate) << "p2p.nodes.drop " << _n->id.abridged();
if (m_nodeEventHandler) if (m_nodeEventHandler)
m_nodeEventHandler->appendEvent(_n->id, NodeEntryRemoved); m_nodeEventHandler->appendEvent(_n->id, NodeEntryRemoved);
} }
@ -376,7 +376,7 @@ void NodeTable::onReceived(UDPSocketFace*, bi::udp::endpoint const& _from, bytes
// h256 + Signature + type + RLP (smallest possible packet is empty neighbours packet which is 3 bytes) // h256 + Signature + type + RLP (smallest possible packet is empty neighbours packet which is 3 bytes)
if (_packet.size() < h256::size + Signature::size + 1 + 3) if (_packet.size() < h256::size + Signature::size + 1 + 3)
{ {
clog(NodeTableMessageSummary) << "Invalid Message size from " << _from.address().to_string() << ":" << _from.port(); clog(NodeTableWarn) << "Invalid Message size from " << _from.address().to_string() << ":" << _from.port();
return; return;
} }
@ -384,7 +384,7 @@ void NodeTable::onReceived(UDPSocketFace*, bi::udp::endpoint const& _from, bytes
h256 hashSigned(sha3(hashedBytes)); h256 hashSigned(sha3(hashedBytes));
if (!_packet.cropped(0, h256::size).contentsEqual(hashSigned.asBytes())) if (!_packet.cropped(0, h256::size).contentsEqual(hashSigned.asBytes()))
{ {
clog(NodeTableMessageSummary) << "Invalid Message hash from " << _from.address().to_string() << ":" << _from.port(); clog(NodeTableWarn) << "Invalid Message hash from " << _from.address().to_string() << ":" << _from.port();
return; return;
} }
@ -396,7 +396,7 @@ void NodeTable::onReceived(UDPSocketFace*, bi::udp::endpoint const& _from, bytes
Public nodeid(dev::recover(*(Signature const*)sigBytes.data(), sha3(signedBytes))); Public nodeid(dev::recover(*(Signature const*)sigBytes.data(), sha3(signedBytes)));
if (!nodeid) if (!nodeid)
{ {
clog(NodeTableMessageSummary) << "Invalid Message signature from " << _from.address().to_string() << ":" << _from.port(); clog(NodeTableWarn) << "Invalid Message signature from " << _from.address().to_string() << ":" << _from.port();
return; return;
} }
@ -516,7 +516,7 @@ void NodeTable::doRefreshBuckets(boost::system::error_code const& _ec)
if (_ec) if (_ec)
return; return;
clog(NodeTableNote) << "refreshing buckets"; clog(NodeTableEvent) << "refreshing buckets";
bool connected = m_socketPointer->isOpen(); bool connected = m_socketPointer->isOpen();
bool refreshed = false; bool refreshed = false;
if (connected) if (connected)

5
libp2p/NodeTable.h

@ -411,8 +411,11 @@ struct Neighbours: RLPXDatagram<Neighbours>
struct NodeTableWarn: public LogChannel { static const char* name() { return "!P!"; } static const int verbosity = 0; }; struct NodeTableWarn: public LogChannel { static const char* name() { return "!P!"; } static const int verbosity = 0; };
struct NodeTableNote: public LogChannel { static const char* name() { return "*P*"; } static const int verbosity = 1; }; struct NodeTableNote: public LogChannel { static const char* name() { return "*P*"; } static const int verbosity = 1; };
struct NodeTableMessageSummary: public LogChannel { static const char* name() { return "-P-"; } static const int verbosity = 2; }; struct NodeTableMessageSummary: public LogChannel { static const char* name() { return "-P-"; } static const int verbosity = 2; };
struct NodeTableConnect: public LogChannel { static const char* name() { return "+P+"; } static const int verbosity = 10; };
struct NodeTableMessageDetail: public LogChannel { static const char* name() { return "=P="; } static const int verbosity = 5; }; struct NodeTableMessageDetail: public LogChannel { static const char* name() { return "=P="; } static const int verbosity = 5; };
struct NodeTableConnect: public LogChannel { static const char* name() { return "+P+"; } static const int verbosity = 10; };
struct NodeTableEvent: public LogChannel { static const char* name() { return "+P+"; } static const int verbosity = 10; };
struct NodeTableTimer: public LogChannel { static const char* name() { return "+P+"; } static const int verbosity = 10; };
struct NodeTableUpdate: public LogChannel { static const char* name() { return "+P+"; } static const int verbosity = 10; };
struct NodeTableTriviaSummary: public LogChannel { static const char* name() { return "-P-"; } static const int verbosity = 10; }; struct NodeTableTriviaSummary: public LogChannel { static const char* name() { return "-P-"; } static const int verbosity = 10; };
struct NodeTableTriviaDetail: public LogChannel { static const char* name() { return "=P="; } static const int verbosity = 11; }; struct NodeTableTriviaDetail: public LogChannel { static const char* name() { return "=P="; } static const int verbosity = 11; };
struct NodeTableAllDetail: public LogChannel { static const char* name() { return "=P="; } static const int verbosity = 13; }; struct NodeTableAllDetail: public LogChannel { static const char* name() { return "=P="; } static const int verbosity = 13; };

10
libp2p/RLPxHandshake.cpp

@ -98,7 +98,7 @@ void RLPXHandshake::readAuth()
} }
else else
{ {
clog(NetWarn) << "p2p.connect.egress recving auth decrypt failed for" << m_socket->remoteEndpoint(); clog(NetConnect) << "p2p.connect.ingress recving auth decrypt failed for" << m_socket->remoteEndpoint();
m_nextState = Error; m_nextState = Error;
transition(); transition();
} }
@ -122,7 +122,7 @@ void RLPXHandshake::readAck()
} }
else else
{ {
clog(NetWarn) << "p2p.connect.egress recving ack decrypt failed for " << m_socket->remoteEndpoint(); clog(NetConnect) << "p2p.connect.egress recving ack decrypt failed for " << m_socket->remoteEndpoint();
m_nextState = Error; m_nextState = Error;
transition(); transition();
} }
@ -162,11 +162,7 @@ void RLPXHandshake::transition(boost::system::error_code _ech)
else if (m_nextState == WriteHello) else if (m_nextState == WriteHello)
{ {
m_nextState = ReadHello; m_nextState = ReadHello;
clog(NetConnect) << (m_originated ? "p2p.connect.egress" : "p2p.connect.ingress") << "sending capabilities handshake";
if (m_originated)
clog(NetConnect) << "p2p.connect.egress sending capabilities handshake";
else
clog(NetConnect) << "p2p.connect.ingress sending capabilities handshake";
/// This pointer will be freed if there is an error otherwise /// This pointer will be freed if there is an error otherwise
/// it will be passed to Host which will take ownership. /// it will be passed to Host which will take ownership.

2
mix/qml/html/WebContainer.html

@ -33,7 +33,7 @@ updateContracts = function(contracts) {
init = function(url) { init = function(url) {
web3 = require('web3'); web3 = require('web3');
window.web3 = web3; window.web3 = web3;
web3.setProvider(new web3.providers.HttpSyncProvider(url)); web3.setProvider(new web3.providers.HttpProvider(url));
}; };
executeJavaScript = function(script) { executeJavaScript = function(script) {

Loading…
Cancel
Save