mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-02-01 07:42:17 +00:00
Remove a redundant null check in checkAESKey()
This commit is contained in:
parent
dc433761dd
commit
c988212441
@ -2799,10 +2799,8 @@ public class Wallet implements Serializable, BlockChainListener {
|
|||||||
lock.lock();
|
lock.lock();
|
||||||
try {
|
try {
|
||||||
// If no keys then cannot decrypt.
|
// If no keys then cannot decrypt.
|
||||||
if (!getKeys().iterator().hasNext()) {
|
if (!getKeys().iterator().hasNext())
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
// Find the first encrypted key in the wallet.
|
// Find the first encrypted key in the wallet.
|
||||||
ECKey firstEncryptedECKey = null;
|
ECKey firstEncryptedECKey = null;
|
||||||
Iterator<ECKey> iterator = getKeys().iterator();
|
Iterator<ECKey> iterator = getKeys().iterator();
|
||||||
@ -2812,15 +2810,11 @@ public class Wallet implements Serializable, BlockChainListener {
|
|||||||
firstEncryptedECKey = loopECKey;
|
firstEncryptedECKey = loopECKey;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// There are no encrypted keys in the wallet.
|
// There are no encrypted keys in the wallet.
|
||||||
if (firstEncryptedECKey == null) {
|
if (firstEncryptedECKey == null)
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
String originalAddress = firstEncryptedECKey.toAddress(getNetworkParameters()).toString();
|
String originalAddress = firstEncryptedECKey.toAddress(getNetworkParameters()).toString();
|
||||||
|
if (firstEncryptedECKey.isEncrypted() && firstEncryptedECKey.getEncryptedPrivateKey() != null) {
|
||||||
if (firstEncryptedECKey != null && firstEncryptedECKey.isEncrypted() && firstEncryptedECKey.getEncryptedPrivateKey() != null) {
|
|
||||||
try {
|
try {
|
||||||
ECKey rebornKey = firstEncryptedECKey.decrypt(keyCrypter, aesKey);
|
ECKey rebornKey = firstEncryptedECKey.decrypt(keyCrypter, aesKey);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user