Skip to content

Commit 908258f

Browse files
committed
Fixed duplicate events from triggering (ethers-io#404).
1 parent 774b2d5 commit 908258f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src.ts/providers/base-provider.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,8 +611,13 @@ export class BaseProvider extends Provider {
611611
let newBalances: any = {};
612612

613613
// Find all transaction hashes we are waiting on
614+
let uniqueEventTags: { [ tag: string ]: boolean } = { };
614615
this._events.forEach((event) => {
615-
let comps = event.tag.split(':');
616+
uniqueEventTags[event.tag] = true;
617+
});
618+
619+
Object.keys(uniqueEventTags).forEach((tag) => {
620+
let comps = tag.split(':');
616621
switch (comps[0]) {
617622
case 'tx': {
618623
let hash = comps[1];

0 commit comments

Comments
 (0)