fix hash issue and 24H changes

This commit is contained in:
liangping 2022-08-28 17:35:01 +08:00
parent b955949c66
commit ecfe1f3ec4
2 changed files with 4 additions and 3 deletions

View File

@ -315,8 +315,8 @@ export default {
return tab.map(x => { return tab.map(x => {
const xh = x const xh = x
if (Object.keys(this.latestPower).length > 0 && Object.keys(this.previousPower).length > 0) { if (Object.keys(this.latestPower).length > 0 && Object.keys(this.previousPower).length > 0) {
const latest = this.latestPower[x.consensus_pubkey.value] || 0 const latest = this.latestPower[x.consensus_pubkey.key] || 0
const previous = this.previousPower[x.consensus_pubkey.value] || 0 const previous = this.previousPower[x.consensus_pubkey.key] || 0
xh.changes = latest - previous xh.changes = latest - previous
} }
return xh return xh

View File

@ -59,6 +59,7 @@
import { import {
BCard, BCardTitle, BFormTextarea, BCard, BCardTitle, BFormTextarea,
} from 'bootstrap-vue' } from 'bootstrap-vue'
import { fromBase64, toHex } from '@cosmjs/encoding'
export default { export default {
components: { components: {
@ -113,7 +114,7 @@ snapshot-keep-recent = 2`,
const { height } = l.block.header const { height } = l.block.header
if (height > interval * 3) { if (height > interval * 3) {
this.$http.getBlockByHeight(Math.trunc((height - 3 * interval) / interval) * interval).then(x => { this.$http.getBlockByHeight(Math.trunc((height - 3 * interval) / interval) * interval).then(x => {
this.hash = x.block_id.hash this.hash = toHex(fromBase64(x.block_id.hash))
this.height = x.block.header.height this.height = x.block.header.height
this.state = `[statesync] this.state = `[statesync]
enable = true enable = true