Fix filters by forcing a poll instantly when polling starts to capture the current block (#613).
This commit is contained in:
parent
b3f5266e78
commit
d0e0e30532
@ -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; }
|
||||
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user