mark node as bad if it returns difficulty 100

pull/1353/head
Audric Ackermann 5 years ago
parent a7e5a9265c
commit d12e0500af
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -327,6 +327,15 @@ export async function storeOnNode(
return false;
} else if (e instanceof textsecure.WrongDifficultyError) {
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)) {
window.storage.put('PoWDifficulty', newDifficulty);
}

Loading…
Cancel
Save