forked from cerc-io/cosmos-explorer
change height
This commit is contained in:
parent
f85684d4db
commit
bbc80bd242
@ -41,17 +41,6 @@
|
|||||||
class="my-1"
|
class="my-1"
|
||||||
@change="check()"
|
@change="check()"
|
||||||
/>
|
/>
|
||||||
<b class="mt-1">3. (Optional) Add Snapshot Providers </b><br>
|
|
||||||
To reduce the time of snapshot discovering, we can add providers into persistent_peers in <code>$DAEMON_HOME/config/config.toml</code>.
|
|
||||||
<b-form-textarea
|
|
||||||
id="provider"
|
|
||||||
v-model="providers"
|
|
||||||
readonly
|
|
||||||
:state="snapshot_provider?true:false"
|
|
||||||
placeholder="Loading..."
|
|
||||||
rows="3"
|
|
||||||
class="mt-1"
|
|
||||||
/>
|
|
||||||
</b-card>
|
</b-card>
|
||||||
|
|
||||||
<b-card>
|
<b-card>
|
||||||
@ -117,8 +106,8 @@ snapshot-keep-recent = 2`,
|
|||||||
const interval = 1000
|
const interval = 1000
|
||||||
this.$http.getLatestBlock().then(l => {
|
this.$http.getLatestBlock().then(l => {
|
||||||
const { height } = l.block.header
|
const { height } = l.block.header
|
||||||
if (height > interval) {
|
if (height > interval * 3) {
|
||||||
this.$http.getBlockByHeight(Math.trunc(height / interval) * interval).then(x => {
|
this.$http.getBlockByHeight(Math.trunc((height - 3 * interval) / interval) * interval).then(x => {
|
||||||
this.hash = x.block_id.hash
|
this.hash = x.block_id.hash
|
||||||
this.height = x.block.header.height
|
this.height = x.block.header.height
|
||||||
this.state = `[statesync]
|
this.state = `[statesync]
|
||||||
|
Loading…
Reference in New Issue
Block a user