Skip to content

Commit

Permalink
fix asynchronous send request method backend bug. fixes #1014 (#1018)
Browse files Browse the repository at this point in the history
resolve asynchronous send request method error by using sendAsync function when running on the backend (Node.js)
  • Loading branch information
Leopold Joy authored and frozeman committed Sep 15, 2017
1 parent 18dffea commit cf013f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/web3-core-requestmanager/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ RequestManager.prototype.send = function (data, callback) {
}

var payload = Jsonrpc.toPayload(data.method, data.params);
this.provider.send(payload, function (err, result) {
this.provider[this.provider.sendAsync ? 'sendAsync' : 'send'](payload, function (err, result) {
if(result && result.id && payload.id !== result.id) return callback(new Error('Wrong response id "'+ result.id +'" (expected: "'+ payload.id +'") in '+ JSON.stringify(payload)));

if (err) {
Expand Down

0 comments on commit cf013f5

Please sign in to comment.