mirror of
https://gitlab.com/pulsechaincom/go-pulse.git
synced 2024-12-24 20:37:17 +00:00
Merge commit '9d84609b3faf797f4a611587abdda3d6b3b07917' into develop
This commit is contained in:
commit
7e0799ff21
31
cmd/mist/assets/ext/ethereum.js/dist/ethereum.js
vendored
31
cmd/mist/assets/ext/ethereum.js/dist/ethereum.js
vendored
@ -1043,33 +1043,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(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);
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
setTimeout(poll, 1000);
|
||||
};
|
||||
poll();
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -42,33 +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(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);
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
setTimeout(poll, 1000);
|
||||
};
|
||||
poll();
|
||||
|
Loading…
Reference in New Issue
Block a user