Minor fix.

pull/14/head
Mikunj 7 years ago committed by Mikunj Varsani
parent 3a03aa8ca8
commit f38ddd052e

@ -21,20 +21,20 @@ NS_ASSUME_NONNULL_BEGIN
- (NSArray<PreKeyRecord *> *)generatePreKeyRecords:(int)batchSize - (NSArray<PreKeyRecord *> *)generatePreKeyRecords:(int)batchSize
{ {
NSMutableArray *preKeyRecords = [NSMutableArray array]; NSMutableArray *preKeyRecords = [NSMutableArray array];
@synchronized(self) @synchronized(self)
{ {
int preKeyId = [self nextPreKeyId:batchSize]; int preKeyId = [self nextPreKeyId:batchSize];
OWSLogInfo(@"building %d new preKeys starting from preKeyId: %d", batchSize, preKeyId); OWSLogInfo(@"building %d new preKeys starting from preKeyId: %d", batchSize, preKeyId);
for (int i = 0; i < batchSize; i++) { for (int i = 0; i < batchSize; i++) {
ECKeyPair *keyPair = [Curve25519 generateKeyPair]; ECKeyPair *keyPair = [Curve25519 generateKeyPair];
PreKeyRecord *record = [[PreKeyRecord alloc] initWithId:preKeyId keyPair:keyPair]; PreKeyRecord *record = [[PreKeyRecord alloc] initWithId:preKeyId keyPair:keyPair];
[preKeyRecords addObject:record]; [preKeyRecords addObject:record];
preKeyId++; preKeyId++;
} }
[self.dbReadWriteConnection setInt:preKeyId [self.dbReadWriteConnection setInt:preKeyId
forKey:TSNextPrekeyIdKey forKey:TSNextPrekeyIdKey
inCollection:TSStorageInternalSettingsCollection]; inCollection:TSStorageInternalSettingsCollection];
@ -42,7 +42,7 @@ NS_ASSUME_NONNULL_BEGIN
return preKeyRecords; return preKeyRecords;
} }
- (NSArray<PreKeyRecord *> *)generatePreKeyRecords; - (NSArray<PreKeyRecord *> *)generatePreKeyRecords
{ {
return [self generatePreKeyRecords:BATCH_SIZE]; return [self generatePreKeyRecords:BATCH_SIZE];
} }

Loading…
Cancel
Save