Skip to content

Commit

Permalink
Use hex strings for filter block handler indices MetaMask#155
Browse files Browse the repository at this point in the history
Using the numeric index `self.filterIndex` results in problems
later on when we try to uninstall handler.
  • Loading branch information
chejazi committed May 30, 2017
1 parent 30f993e commit c0a9da1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions subproviders/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ FilterSubprovider.prototype.newLogFilter = function(opts, cb) {
}

self.filterIndex++
self.asyncBlockHandlers[self.filterIndex] = blockHandler
var hexFilterIndex = intToHex(self.filterIndex)
self.asyncBlockHandlers[hexFilterIndex] = blockHandler
self.filters[hexFilterIndex] = filter

cb(null, hexFilterIndex)
Expand All @@ -153,8 +153,8 @@ FilterSubprovider.prototype.newPendingTransactionFilter = function(cb) {
}

self.filterIndex++
self.asyncPendingBlockHandlers[self.filterIndex] = blockHandler
var hexFilterIndex = intToHex(self.filterIndex)
self.asyncPendingBlockHandlers[hexFilterIndex] = blockHandler
self.filters[hexFilterIndex] = filter

cb(null, hexFilterIndex)
Expand Down

0 comments on commit c0a9da1

Please sign in to comment.