synchronize around identity key generation

This commit is contained in:
Daniel Gultsch 2016-05-19 10:39:47 +02:00
parent b478eca315
commit afa3883089

View file

@ -90,6 +90,7 @@ public class SQLiteAxolotlStore implements AxolotlStore {
// -------------------------------------- // --------------------------------------
private IdentityKeyPair loadIdentityKeyPair() { private IdentityKeyPair loadIdentityKeyPair() {
synchronized (mXmppConnectionService) {
IdentityKeyPair ownKey = mXmppConnectionService.databaseBackend.loadOwnIdentityKeyPair(account); IdentityKeyPair ownKey = mXmppConnectionService.databaseBackend.loadOwnIdentityKeyPair(account);
if (ownKey != null) { if (ownKey != null) {
@ -101,6 +102,7 @@ public class SQLiteAxolotlStore implements AxolotlStore {
} }
return ownKey; return ownKey;
} }
}
private int loadRegistrationId() { private int loadRegistrationId() {
return loadRegistrationId(false); return loadRegistrationId(false);