|
@ -8,7 +8,16 @@ import { |
|
|
import Config from '../../config'; |
|
|
import Config from '../../config'; |
|
|
|
|
|
|
|
|
// TODO: use debug.log instead
|
|
|
// TODO: use debug.log instead
|
|
|
export function getSyncInfoNativeKMD(skipDebug, json) { |
|
|
export function getSyncInfoNativeKMD(skipDebug, json, skipRemote) { |
|
|
|
|
|
if (skipRemote) { |
|
|
|
|
|
return dispatch => { |
|
|
|
|
|
dispatch(getSyncInfoNativeState(Config.iguanaLessMode ? json.info : json )); |
|
|
|
|
|
|
|
|
|
|
|
if (!skipDebug) { |
|
|
|
|
|
dispatch(getDebugLog('komodo', 1)); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
const coin = 'KMD'; |
|
|
const coin = 'KMD'; |
|
|
// https://www.kmd.host/
|
|
|
// https://www.kmd.host/
|
|
|
return dispatch => { |
|
|
return dispatch => { |
|
@ -39,13 +48,14 @@ export function getSyncInfoNativeKMD(skipDebug, json) { |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
function getSyncInfoNativeState(json, coin, skipDebug) { |
|
|
function getSyncInfoNativeState(json, coin, skipDebug, skipRemote) { |
|
|
if (coin === 'KMD' && |
|
|
if (coin === 'KMD' && |
|
|
json && |
|
|
json && |
|
|
json.error && |
|
|
json.error && |
|
|
json.error.message.indexOf('Activating best') === -1) { |
|
|
json.error.message.indexOf('Activating best') === -1) { |
|
|
return getSyncInfoNativeKMD(skipDebug, json); |
|
|
return getSyncInfoNativeKMD(skipDebug, json, skipRemote); |
|
|
} else { |
|
|
} else { |
|
|
if (json && |
|
|
if (json && |
|
|
json.error && |
|
|
json.error && |
|
@ -63,7 +73,7 @@ function getSyncInfoNativeState(json, coin, skipDebug) { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
export function getSyncInfoNative(coin, skipDebug) { |
|
|
export function getSyncInfoNative(coin, skipDebug, skipRemote) { |
|
|
let payload = { |
|
|
let payload = { |
|
|
userpass: `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`, |
|
|
userpass: `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`, |
|
|
agent: getPassthruAgent(coin), |
|
|
agent: getPassthruAgent(coin), |
|
@ -125,7 +135,8 @@ export function getSyncInfoNative(coin, skipDebug) { |
|
|
id: null |
|
|
id: null |
|
|
}, |
|
|
}, |
|
|
coin, |
|
|
coin, |
|
|
skipDebug |
|
|
skipDebug, |
|
|
|
|
|
skipRemote |
|
|
) |
|
|
) |
|
|
); |
|
|
); |
|
|
} else { |
|
|
} else { |
|
@ -163,7 +174,8 @@ export function getSyncInfoNative(coin, skipDebug) { |
|
|
getSyncInfoNativeState( |
|
|
getSyncInfoNativeState( |
|
|
json, |
|
|
json, |
|
|
coin, |
|
|
coin, |
|
|
skipDebug |
|
|
skipDebug, |
|
|
|
|
|
skipRemote |
|
|
) |
|
|
) |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|