mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Minor fix.
This commit is contained in:
parent
3a03aa8ca8
commit
f38ddd052e
1 changed files with 5 additions and 5 deletions
|
@ -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];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue