DeterministicSeed: Make encryptedSeed immutable.

This commit is contained in:
Andreas Schildbach
2019-02-13 10:23:48 +01:00
parent 02b0907535
commit 4789ea84a5

View File

@@ -49,7 +49,7 @@ public class DeterministicSeed implements EncryptableItem {
@Nullable private final byte[] seed;
@Nullable private final List<String> mnemonicCode; // only one of mnemonicCode/encryptedMnemonicCode will be set
@Nullable private final EncryptedData encryptedMnemonicCode;
@Nullable private EncryptedData encryptedSeed;
@Nullable private final EncryptedData encryptedSeed;
private long creationTimeSeconds;
public DeterministicSeed(String mnemonicCode, byte[] seed, String passphrase, long creationTimeSeconds) throws UnreadableWalletException {
@@ -60,6 +60,7 @@ public class DeterministicSeed implements EncryptableItem {
this.seed = checkNotNull(seed);
this.mnemonicCode = checkNotNull(mnemonic);
this.encryptedMnemonicCode = null;
this.encryptedSeed = null;
this.creationTimeSeconds = creationTimeSeconds;
}
@@ -114,6 +115,7 @@ public class DeterministicSeed implements EncryptableItem {
}
this.seed = MnemonicCode.toSeed(mnemonicCode, passphrase);
this.encryptedMnemonicCode = null;
this.encryptedSeed = null;
this.creationTimeSeconds = creationTimeSeconds;
}