Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Feb 12, 2019

Conversation

frankiebee
Copy link
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
Collaborator

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

try {
await this.processBlock(newBlockNumberHex)
} catch (err) {
log.error(err)
}
}
let isListeng = false
Copy link
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
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) {

try {
await this.processBlock(newBlockNumberHex)
} catch (err) {
log.error(err)
}
}
let isListeng = false
Copy link
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
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
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