Skip to content

Commit

Permalink
Fix filters by forcing a poll instantly when polling starts to captur…
Browse files Browse the repository at this point in the history
…e the current block (#613).
  • Loading branch information
ricmoo committed Oct 30, 2019
1 parent b3f5266 commit d0e0e30
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src.ts/providers/base-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,7 @@ export class BaseProvider extends Provider {
toBlock: blockNumber,
topics: topics
}

if (!filter.address) { delete filter.address; }
this.getLogs(filter).then((logs) => {
if (logs.length === 0) { return; }
Expand Down Expand Up @@ -716,6 +717,7 @@ export class BaseProvider extends Provider {
setTimeout(() => {
if (value && !this._poller) {
this._poller = setInterval(this._doPoll.bind(this), this.pollingInterval);
this._doPoll();

} else if (!value && this._poller) {
clearInterval(this._poller);
Expand Down

0 comments on commit d0e0e30

Please sign in to comment.