Merge pull request #1353 from Bilb/bad-snode-difficulty-100

mark node as bad if it returns difficulty 100
pull/1360/head
Audric Ackermann 5 years ago committed by GitHub
commit c3e2397b0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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