Browse Source

Merge branch 'nobatch' of https://github.com/debris/cpp-ethereum into debris-nobatch

Conflicts:
	libjsqrc/ethereumjs/dist/ethereum.js
	libjsqrc/ethereumjs/dist/ethereum.js.map
	libjsqrc/ethereumjs/dist/ethereum.min.js
	libjsqrc/ethereumjs/lib/providermanager.js
cl-refactor
Gav Wood 10 years ago
parent
commit
f594c0fd64
  1. 35
      libjsqrc/ethereumjs/dist/ethereum.js
  2. 4
      libjsqrc/ethereumjs/dist/ethereum.js.map
  3. 2
      libjsqrc/ethereumjs/dist/ethereum.min.js
  4. 35
      libjsqrc/ethereumjs/lib/providermanager.js

35
libjsqrc/ethereumjs/dist/ethereum.js

@ -1043,37 +1043,16 @@ var ProviderManager = function() {
var self = this;
var poll = function () {
if (self.provider) {
var pollsBatch = self.polls.map(function (data) {
return data.data;
});
var payload = jsonrpc.toBatchPayload(pollsBatch);
var results = self.provider.send(payload);
self.polls.forEach(function (data, index) {
var result = results[index];
if (!jsonrpc.isValidResponse(result)) {
console.log("INVALID RESPONSE");
console.log("results:" + JSON.stringify(results));
console.log("data:" + JSON.stringify(data));
console.log("index:" + index);
console.log("result:" + JSON.stringify(result));
return;
}
self.polls.forEach(function (data) {
var result = self.send(data.data);
result = result.result;
// dont call the callback if result is not an array, or empty one
if (!(result instanceof Array) || result.length === 0) {
return;
}
data.callback(result);
if (!(result instanceof Array) || result.length === 0) {
return;
}
});il
data.callback(result);
});
}
setTimeout(poll, 1000);
};
poll();

4
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

35
libjsqrc/ethereumjs/lib/providermanager.js

@ -42,37 +42,16 @@ var ProviderManager = function() {
var self = this;
var poll = function () {
if (self.provider) {
var pollsBatch = self.polls.map(function (data) {
return data.data;
});
self.polls.forEach(function (data) {
var result = self.send(data.data);
var payload = jsonrpc.toBatchPayload(pollsBatch);
var results = self.provider.send(payload);
if (!(result instanceof Array) || result.length === 0) {
return;
}
self.polls.forEach(function (data, index) {
var result = results[index];
data.callback(result);
});
if (!jsonrpc.isValidResponse(result)) {
console.log("INVALID RESPONSE");
console.log("results:" + JSON.stringify(results));
console.log("data:" + JSON.stringify(data));
console.log("index:" + index);
console.log("result:" + JSON.stringify(result));
return;
}
result = result.result;
// dont call the callback if result is not an array, or empty one
if (!(result instanceof Array) || result.length === 0) {
return;
}
data.callback(result);
});il
}
setTimeout(poll, 1000);
};
poll();

Loading…
Cancel
Save