Merge pull request #578 from zcash/decrease_batches_on_bloated_chain
[#577] Fix: reduce batch size when reaching increased load part of th…
This commit is contained in:
commit
c1c3762ce5
|
@ -13,7 +13,9 @@ extension CompactBlockProcessor {
|
|||
try Task.checkCancellation()
|
||||
|
||||
setState(.scanning)
|
||||
let batchSize = UInt32(config.scanningBatchSize)
|
||||
|
||||
// TODO: remove this arbitrary batch size https://github.com/zcash/ZcashLightClientKit/issues/576
|
||||
let batchSize = scanBatchSize(for: range, network: self.config.network.networkType)
|
||||
|
||||
do {
|
||||
if batchSize == 0 {
|
||||
|
@ -92,6 +94,17 @@ extension CompactBlockProcessor {
|
|||
throw error
|
||||
}
|
||||
}
|
||||
|
||||
fileprivate func scanBatchSize(for range: CompactBlockRange, network: NetworkType) -> UInt32 {
|
||||
guard network == .mainnet else {
|
||||
return UInt32(config.scanningBatchSize)
|
||||
}
|
||||
if range.lowerBound > 1_600_000 {
|
||||
return 5
|
||||
}
|
||||
|
||||
return UInt32(config.scanningBatchSize)
|
||||
}
|
||||
}
|
||||
|
||||
extension CompactBlockProcessor {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
Pod::Spec.new do |s|
|
||||
s.name = 'ZcashLightClientKit'
|
||||
s.version = '0.16.10-beta'
|
||||
s.version = '0.17.0-alpha.1'
|
||||
s.summary = 'Zcash Light Client wallet SDK for iOS'
|
||||
|
||||
s.description = <<-DESC
|
||||
|
|
Loading…
Reference in New Issue