Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
82cc5f63
Commit
82cc5f63
authored
Feb 05, 2015
by
Marek Kotewicz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bring back jsonrpc single method calls in polling
parent
f3e17971
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
51 deletions
+17
-51
ethereum.js
dist/ethereum.js
+7
-24
ethereum.js.map
dist/ethereum.js.map
+2
-2
ethereum.min.js
dist/ethereum.min.js
+1
-1
providermanager.js
lib/providermanager.js
+7
-24
No files found.
dist/ethereum.js
View file @
82cc5f63
...
...
@@ -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
;
});
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
(
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
;
}
self
.
polls
.
forEach
(
function
(
data
)
{
var
result
=
self
.
send
(
data
.
data
);
data
.
callback
(
result
);
if
(
!
(
result
instanceof
Array
)
||
result
.
length
===
0
)
{
return
;
}
});
data
.
callback
(
result
);
});
}
setTimeout
(
poll
,
1000
);
};
poll
();
...
...
dist/ethereum.js.map
View file @
82cc5f63
This diff is collapsed.
Click to expand it.
dist/ethereum.min.js
View file @
82cc5f63
This diff is collapsed.
Click to expand it.
lib/providermanager.js
View file @
82cc5f63
...
...
@@ -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
];
if
(
!
jsonrpc
.
isValidResponse
(
result
))
{
console
.
log
(
result
);
return
;
}
data
.
callback
(
result
);
});
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
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment