3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-01-31 23:32:16 +00:00

Remove a redundant null check in checkAESKey()

This commit is contained in:
Mike Hearn 2013-03-15 16:11:29 +01:00
parent dc433761dd
commit c988212441

View File

@ -2799,10 +2799,8 @@ public class Wallet implements Serializable, BlockChainListener {
lock.lock();
try {
// If no keys then cannot decrypt.
if (!getKeys().iterator().hasNext()) {
if (!getKeys().iterator().hasNext())
return false;
}
// Find the first encrypted key in the wallet.
ECKey firstEncryptedECKey = null;
Iterator<ECKey> iterator = getKeys().iterator();
@ -2812,15 +2810,11 @@ public class Wallet implements Serializable, BlockChainListener {
firstEncryptedECKey = loopECKey;
}
}
// There are no encrypted keys in the wallet.
if (firstEncryptedECKey == null) {
if (firstEncryptedECKey == null)
return false;
}
String originalAddress = firstEncryptedECKey.toAddress(getNetworkParameters()).toString();
if (firstEncryptedECKey != null && firstEncryptedECKey.isEncrypted() && firstEncryptedECKey.getEncryptedPrivateKey() != null) {
if (firstEncryptedECKey.isEncrypted() && firstEncryptedECKey.getEncryptedPrivateKey() != null) {
try {
ECKey rebornKey = firstEncryptedECKey.decrypt(keyCrypter, aesKey);