minor change on hardfork version check

This commit is contained in:
ryanzhao 2022-05-04 16:43:22 +10:00
parent 372e87e70f
commit 782d51c1d6
2 changed files with 2 additions and 2 deletions

View file

@ -89,7 +89,7 @@ public final class ClosedGroupPoller : NSObject {
Threading.pollerQueue.async {
var promises: [Promise<Void>] = []
if let promise = self?.poll(groupPublicKey) { promises.append(promise) }
if SnodeAPI.inHardfork, let promise = self?.poll(groupPublicKey, defaultInbox: true) { promises.append(promise) }
if SnodeAPI.duringHardforkTransition, let promise = self?.poll(groupPublicKey, defaultInbox: true) { promises.append(promise) }
when(resolved: promises).done(on: Threading.pollerQueue) { _ in
self?.pollRecursively(groupPublicKey)
}.catch(on: Threading.pollerQueue) { error in

View file

@ -31,7 +31,7 @@ public final class SnodeAPI : NSObject {
// MARK: Hardfork version
private static var hardfork = UserDefaults.standard[.hardfork]
private static var softfork = UserDefaults.standard[.softfork]
public static var inHardfork: Bool { hardfork >= 19 && softfork >= 1 }
public static var duringHardforkTransition: Bool { hardfork == 19 && softfork == 0 }
// MARK: Settings
private static let maxRetryCount: UInt = 8