Because we can check whether decrypt returns null.
And, decrypt is a heavy computation operation, we should avoid call it twice(checkByPassword will call it again)
Because we can check whether decrypt returns null.
And, decrypt is a heavy computation operation, we should avoid call it twice(checkByPassword will call it again)
https://github.com/rebase-network/synapse-extension/blob/af0985a81b5a6d578b3605bb459b4487283ffab4/src/wallet/passwordEncryptor.ts#L17
https://github.com/rebase-network/synapse-extension/blob/af0985a81b5a6d578b3605bb459b4487283ffab4/src/background/index.ts#L601
Because we can check whether
decrypt
returns null. And,decrypt
is a heavy computation operation, we should avoid call it twice(checkByPassword will call it again)