forked from cerc-io/cosmos-explorer
update missing count in a fixed period
This commit is contained in:
parent
3425b8eb8c
commit
b646c4a76b
@ -283,9 +283,20 @@ export default {
|
|||||||
if (cached) {
|
if (cached) {
|
||||||
this.validators = cached
|
this.validators = cached
|
||||||
}
|
}
|
||||||
|
this.fetchMissingInfo()
|
||||||
this.$http.getValidatorList().then(res => {
|
this.$http.getValidatorList().then(res => {
|
||||||
this.validators = res
|
this.validators = res
|
||||||
})
|
})
|
||||||
|
|
||||||
|
this.initBlocks()
|
||||||
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
this.blocks = [] // clear running tasks if it is not finish
|
||||||
|
this.syncing = false
|
||||||
|
clearInterval(this.timer)
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
fetchMissingInfo() {
|
||||||
this.$http.getSlashingSigningInfo().then(res => {
|
this.$http.getSlashingSigningInfo().then(res => {
|
||||||
if (res.info) {
|
if (res.info) {
|
||||||
res.info.forEach(x => {
|
res.info.forEach(x => {
|
||||||
@ -296,14 +307,7 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.initBlocks()
|
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
|
||||||
this.blocks = [] // clear running tasks if it is not finish
|
|
||||||
this.syncing = false
|
|
||||||
clearInterval(this.timer)
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
pinValidator() {
|
pinValidator() {
|
||||||
localStorage.setItem('pinned', this.pinned)
|
localStorage.setItem('pinned', this.pinned)
|
||||||
},
|
},
|
||||||
@ -387,6 +391,9 @@ export default {
|
|||||||
if (x.validator_address) sigs[x.validator_address] = 'bg-success'
|
if (x.validator_address) sigs[x.validator_address] = 'bg-success'
|
||||||
})
|
})
|
||||||
this.height = res.block.header.height
|
this.height = res.block.header.height
|
||||||
|
if (Number(this.height) % 100 === 0) { // update the missing number each 100
|
||||||
|
this.fetchMissingInfo()
|
||||||
|
}
|
||||||
const block = this.blocks.find(b => b.height === res.block.last_commit.height)
|
const block = this.blocks.find(b => b.height === res.block.last_commit.height)
|
||||||
if (typeof block === 'undefined') { // mei
|
if (typeof block === 'undefined') { // mei
|
||||||
// this.$set(block, 0, typeof sigs !== 'undefined')
|
// this.$set(block, 0, typeof sigs !== 'undefined')
|
||||||
|
Loading…
Reference in New Issue
Block a user