|
|
@ -327,6 +327,15 @@ export async function storeOnNode(
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
} else if (e instanceof textsecure.WrongDifficultyError) {
|
|
|
|
} else if (e instanceof textsecure.WrongDifficultyError) {
|
|
|
|
const { newDifficulty } = e;
|
|
|
|
const { newDifficulty } = e;
|
|
|
|
|
|
|
|
// difficulty of 100 happens when a snode restarts. We have to exit the loop and markNodeUnreachable()
|
|
|
|
|
|
|
|
if (newDifficulty === 100) {
|
|
|
|
|
|
|
|
log.warn(
|
|
|
|
|
|
|
|
'loki_message:::storeOnNode - invalid new difficulty:100. Marking node as bad.'
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
successiveFailures = MAX_ACCEPTABLE_FAILURES;
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!Number.isNaN(newDifficulty)) {
|
|
|
|
if (!Number.isNaN(newDifficulty)) {
|
|
|
|
window.storage.put('PoWDifficulty', newDifficulty);
|
|
|
|
window.storage.put('PoWDifficulty', newDifficulty);
|
|
|
|
}
|
|
|
|
}
|
|
|
|