Skip to content

Commit

Permalink
Update sockets to conditionally pass back only blocks or transactions.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel Cardona committed Jul 30, 2018
1 parent ee5f7fa commit 1fab387
Show file tree
Hide file tree
Showing 4 changed files with 1,618 additions and 1,609 deletions.
16 changes: 9 additions & 7 deletions lib/Socket.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,15 @@ var Socket = function () {
value: function listen(endpoint, cb) {
this.socket.emit(endpoint);

this.socket.on('blocks', function (msg) {
return cb(msg);
});

this.socket.on('transactions', function (msg) {
return cb(msg);
});
if (endpoint === 'blocks') {
this.socket.on('blocks', function (msg) {
return cb(msg);
});
} else if (endpoint === 'transactions') {
this.socket.on('transactions', function (msg) {
return cb(msg);
});
}
}
}]);

Expand Down
Loading

0 comments on commit 1fab387

Please sign in to comment.