Skip to content

recent-blocks - dont listen for block when on infura providers#6124

Merged
tmashuang merged 2 commits intodevelopfrom
dissable-recent-block-controller
Feb 12, 2019
Merged

recent-blocks - dont listen for block when on infura providers#6124
tmashuang merged 2 commits intodevelopfrom
dissable-recent-block-controller

Conversation

@frankiebee
Copy link
Copy Markdown
Contributor

@frankiebee frankiebee commented Feb 8, 2019

this will remove the listener off the block tracker when on infura providers sense it is not needed

that will allow the block tracker to stop polling

@frankiebee frankiebee added DO-NOT-MERGE Pull requests that should not be merged N04-needsQA labels Feb 8, 2019
@frankiebee frankiebee force-pushed the dissable-recent-block-controller branch 2 times, most recently from 20dd7ae to 30f25a6 Compare February 11, 2019 19:13
@frankiebee frankiebee force-pushed the dissable-recent-block-controller branch from 30f25a6 to 7e64a57 Compare February 11, 2019 19:16
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [7e64a57]: mascara, chrome, firefox, edge, opera

log.error(err)
}
}
let isListeng = false
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small typo, should be isListening

@frankiebee frankiebee removed the DO-NOT-MERGE Pull requests that should not be merged label Feb 12, 2019
isListeng = true
}
networkController.on('networkDidChange', (newType) => {
if (INFURA_PROVIDER_TYPES.includes(newType) && isListeng) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (INFURA_PROVIDER_TYPES.includes(newType) && isListeng) {
if (INFURA_PROVIDER_TYPES.includes(newType) && isListening) {

log.error(err)
}
}
let isListeng = false
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let isListeng = false
let isListening = false

} else if (
!INFURA_PROVIDER_TYPES.includes(type) &&
type !== 'loading' &&
!isListeng
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
!isListeng
!isListening

@frankiebee frankiebee force-pushed the dissable-recent-block-controller branch from 237f859 to c10fb3c Compare February 12, 2019 19:05
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [c10fb3c]: mascara, chrome, firefox, edge, opera

@tmashuang tmashuang dismissed whymarrh’s stale review February 12, 2019 19:42

Typo isListeng has been changed to isListening

@tmashuang tmashuang merged commit c54656e into develop Feb 12, 2019
@tmashuang tmashuang deleted the dissable-recent-block-controller branch February 12, 2019 19:42
@danfinlay danfinlay mentioned this pull request Feb 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants