fix: blockchain status

This commit is contained in:
Sérgio Salgado 2022-01-24 15:56:43 +00:00
parent 2819b8a519
commit 9411b2ea69
6 changed files with 25 additions and 8 deletions

View file

@ -126,7 +126,7 @@ function supportsBatching (cryptoCode) {
function checkBlockchainStatus (cryptoCode) {
return checkCryptoCode(cryptoCode)
.then(() => fetch('getblockchaininfo'))
.then(res => !!res['initialblockdownload'] ? 'ready' : 'syncing')
.then(res => !!res['initialblockdownload'] ? 'syncing' : 'ready')
}
module.exports = {

View file

@ -179,7 +179,7 @@ function supportsBatching (cryptoCode) {
function checkBlockchainStatus (cryptoCode) {
return checkCryptoCode(cryptoCode)
.then(() => fetch('getblockchaininfo'))
.then(res => !!res['initialblockdownload'] ? 'ready' : 'syncing')
.then(res => !!res['initialblockdownload'] ? 'syncing' : 'ready')
}
module.exports = {

View file

@ -121,7 +121,7 @@ function supportsBatching (cryptoCode) {
function checkBlockchainStatus (cryptoCode) {
return checkCryptoCode(cryptoCode)
.then(() => fetch('getblockchaininfo'))
.then(res => !!res['initialblockdownload'] ? 'ready' : 'syncing')
.then(res => !!res['initialblockdownload'] ? 'syncing' : 'ready')
}
module.exports = {

View file

@ -121,7 +121,7 @@ function supportsBatching (cryptoCode) {
function checkBlockchainStatus (cryptoCode) {
return checkCryptoCode(cryptoCode)
.then(() => fetch('getblockchaininfo'))
.then(res => !!res['initialblockdownload'] ? 'ready' : 'syncing')
.then(res => !!res['initialblockdownload'] ? 'syncing' : 'ready')
}
module.exports = {

View file

@ -219,7 +219,10 @@ function checkBlockchainStatus (cryptoCode) {
}
return jsonRpc.fetchDigest(rpcConfig, 'get_info')
.then(res => !!res.synchronized ? 'ready' : 'syncing')
.then(res => {
console.log('res XMR', res)
return !!res.synchronized ? 'ready' : 'syncing'
})
} catch (err) {
throw new Error('XMR daemon is currently not installed')
}