collapse difficulty branching

pull/988/head
Ryan Tharp 5 years ago
parent d15445a1e0
commit 8bf77ce44f

@ -209,12 +209,14 @@ class LokiMessageAPI {
// Make sure we aren't doing too much PoW // Make sure we aren't doing too much PoW
const currentDifficulty = window.storage.get('PoWDifficulty', null); const currentDifficulty = window.storage.get('PoWDifficulty', null);
if (result && result.difficulty) { if (
const newDifficulty = result.difficulty; result &&
if (newDifficulty != null && newDifficulty !== currentDifficulty) { result.difficulty &&
window.storage.put('PoWDifficulty', newDifficulty); result.difficulty !== currentDifficulty
} ) {
} // else should we return false? window.storage.put('PoWDifficulty', result.difficulty);
// should we return false?
}
return true; return true;
} catch (e) { } catch (e) {
log.warn( log.warn(

Loading…
Cancel
Save