Minor fix.

This commit is contained in:
Mikunj 2019-05-14 09:23:05 +10:00 committed by Mikunj Varsani
parent 3a03aa8ca8
commit f38ddd052e

View file

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