Browse Source

importprivkey edge case progress

all-modes
pbca26 8 years ago
parent
commit
e8ca9d849a
  1. 20
      react/src/actions/actions/nativeSyncInfo.js

20
react/src/actions/actions/nativeSyncInfo.js

@ -11,7 +11,7 @@ import {
} from './log'; } from './log';
import Config from '../../config'; import Config from '../../config';
export function getSyncInfoNativeKMD(skipDebug) { export function getSyncInfoNativeKMD(skipDebug, json) {
const coin = 'KMD'; const coin = 'KMD';
return dispatch => { return dispatch => {
@ -40,13 +40,15 @@ export function getSyncInfoNativeKMD(skipDebug) {
'response': error, 'response': error,
})); }));
} }
dispatch( /*dispatch(
triggerToaster( triggerToaster(
'getSyncInfoNativeKMD', 'getSyncInfoNativeKMD',
'Error', 'Error',
'error' 'error'
) )
); );*/
console.warn('remote kmd node fetch failed', true);
dispatch(getSyncInfoNativeState({ 'remoteKMDNode': null }));
}) })
.then(response => response.json()) .then(response => response.json())
.then(json => { .then(json => {
@ -72,7 +74,7 @@ function getSyncInfoNativeState(json, coin, skipDebug) {
json && json &&
json.error && json.error &&
json.error.message.indexOf('Activating best') === -1) { json.error.message.indexOf('Activating best') === -1) {
return getSyncInfoNativeKMD(skipDebug); return getSyncInfoNativeKMD(skipDebug, json);
} else { } else {
if (json && if (json &&
json.error && json.error &&
@ -161,6 +163,15 @@ export function getSyncInfoNative(coin, skipDebug) {
return _response; return _response;
}) })
.then(json => { .then(json => {
if (json === 'Work queue depth exceeded') {
dispatch(
getSyncInfoNativeState(
{ result: 'daemon is busy', error: null, id: null },
coin,
skipDebug
)
);
} else {
if (!json && if (!json &&
Config.cli.default) { Config.cli.default) {
dispatch( dispatch(
@ -196,6 +207,7 @@ export function getSyncInfoNative(coin, skipDebug) {
skipDebug skipDebug
) )
); );
}
}) })
} }
} }
Loading…
Cancel
Save