Bug fix: lastest block height via blockbook
This commit is contained in:
parent
8d1b869831
commit
e3a0bfe267
@ -500,9 +500,10 @@ function processAll() {
|
|||||||
var lastSyncBlockHeight = 0;
|
var lastSyncBlockHeight = 0;
|
||||||
|
|
||||||
function periodicProcess() {
|
function periodicProcess() {
|
||||||
floBlockchainAPI.promisedAPI('api/blocks?limit=1').then(result => {
|
floBlockchainAPI.promisedAPI('api/status').then(result => {
|
||||||
if (lastSyncBlockHeight < result.blocks[0].height) {
|
let blockbook_height = result.blockbook.bestHeight;
|
||||||
lastSyncBlockHeight = result.blocks[0].height;
|
if (lastSyncBlockHeight < blockbook_height) {
|
||||||
|
lastSyncBlockHeight = blockbook_height;
|
||||||
processAll();
|
processAll();
|
||||||
console.log("Last Block :", lastSyncBlockHeight);
|
console.log("Last Block :", lastSyncBlockHeight);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user