Skip to content
This repository has been archived by the owner on Oct 28, 2022. It is now read-only.

Commit

Permalink
Merge pull request #210 from horizontalsystems/bugfixes
Browse files Browse the repository at this point in the history
Bugfixes
  • Loading branch information
ealymbaev committed Dec 14, 2018
2 parents 4f5fee2 + 2dcf4c1 commit b177338
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 36 deletions.
18 changes: 9 additions & 9 deletions HSBitcoinKit.podspec
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = 'HSBitcoinKit'
spec.version = '0.1.3'
spec.version = '0.1.4'
spec.summary = 'Bitcoin wallet library for Swift'
spec.description = <<-DESC
HSBitcoinKit implements Bitcoin protocol in Swift. It is an implementation of the Bitcoin SPV protocol written (almost) entirely in swift.
Expand All @@ -17,12 +17,12 @@ Pod::Spec.new do |spec|
spec.ios.deployment_target = '11.0'
spec.swift_version = '4.1'

spec.dependency 'HSCryptoKit'
spec.dependency 'HSHDWalletKit', '~> 1.0.1'
spec.dependency 'Alamofire'
spec.dependency 'ObjectMapper'
spec.dependency 'RxSwift'
spec.dependency 'BigInt'
spec.dependency 'RealmSwift'
spec.dependency 'RxRealm'
spec.dependency 'HSCryptoKit', '~> 1.0.1'
spec.dependency 'HSHDWalletKit', '~> 1.0.2'
spec.dependency 'Alamofire', '~> 4.7.3'
spec.dependency 'ObjectMapper', '~> 3.3.0'
spec.dependency 'RxSwift', '~> 4.3.1'
spec.dependency 'BigInt', '~> 3.1.0'
spec.dependency 'RealmSwift', '~> 3.11.0'
spec.dependency 'RxRealm', '~> 0.7.5'
end
3 changes: 2 additions & 1 deletion HSBitcoinKit/HSBitcoinKit/Managers/InitialSyncer.swift
Expand Up @@ -77,7 +77,8 @@ class InitialSyncer {
logger?.debug("Account \(account) has \(keys.count) keys and \(blocks.count) blocks")
try addressManager.addKeys(keys: keys)

if blocks.isEmpty {
// If gap shift is found
if keys.count <= hdWallet.gapLimit * 2 {
syncing = false
stateManager.restored = true
peerGroup.start()
Expand Down
6 changes: 4 additions & 2 deletions HSBitcoinKit/HSBitcoinKit/Network/Peer/Peer.swift
Expand Up @@ -294,8 +294,10 @@ extension Peer: PeerConnectionDelegate {
func connectionTimePeriodPassed() {
connectionTimeoutManager.timePeriodPassed(peer: self)

if let task = tasks.first {
task.checkTimeout()
queue.async {
if let task = self.tasks.first {
task.checkTimeout()
}
}
}

Expand Down
Expand Up @@ -2,7 +2,7 @@ import Foundation

class GetMerkleBlocksTask: PeerTask {

private let allowedIdleTime = 5.0
private let allowedIdleTime = 60.0
private var blockHashes: [BlockHash]
private var pendingMerkleBlocks = [MerkleBlock]()

Expand Down
Expand Up @@ -16,7 +16,7 @@ class GetMerkleBlockTaskTests:XCTestCase {
private var blockHeaders: [BlockHeader]!
private var task: GetMerkleBlocksTask!

private let allowedIdleTime = 5.0
private let allowedIdleTime = 60.0

override func setUp() {
super.setUp()
Expand Down
Expand Up @@ -67,6 +67,7 @@ class PeerConnectionDelegateTests: XCTestCase {

peer.add(task: mockTask)
peer.connectionTimePeriodPassed()
waitForMainQueue()
verify(mockConnectionTimeoutManager).timePeriodPassed(peer: equal(to: peer, equalWhen: { $0.host == $1.host }))
verify(mockTask).checkTimeout()
}
Expand Down
16 changes: 8 additions & 8 deletions Podfile
Expand Up @@ -10,21 +10,21 @@ project 'HSBitcoinKit/HSBitcoinKit'


def internal_pods
pod 'HSCryptoKit'
pod 'HSHDWalletKit', '~> 1.0.1'
pod 'HSCryptoKit', '~> 1.0.1'
pod 'HSHDWalletKit', '~> 1.0.2'
end

def kit_pods
internal_pods

pod 'Alamofire'
pod 'ObjectMapper'
pod 'Alamofire', '~> 4.7.3'
pod 'ObjectMapper', '~> 3.3.0'

pod 'RxSwift'
pod 'RxSwift', '~> 4.3.1'

pod 'BigInt'
pod 'RealmSwift'
pod 'RxRealm'
pod 'BigInt', '~> 3.1.0'
pod 'RealmSwift', '~> 3.11.0'
pod 'RxRealm', '~> 0.7.5'
end

target :HSBitcoinKitDemo do
Expand Down
28 changes: 14 additions & 14 deletions Podfile.lock
Expand Up @@ -3,9 +3,9 @@ PODS:
- BigInt (3.1.0):
- SipHash (~> 1.2)
- Cuckoo (0.11.3)
- HSCryptoKit (1.0.0)
- HSHDWalletKit (1.0.1):
- HSCryptoKit
- HSCryptoKit (1.0.1)
- HSHDWalletKit (1.0.2):
- HSCryptoKit (~> 1.0.1)
- ObjectMapper (3.3.0)
- Realm (3.11.0):
- Realm/Headers (= 3.11.0)
Expand All @@ -19,15 +19,15 @@ PODS:
- SipHash (1.2.2)

DEPENDENCIES:
- Alamofire
- BigInt
- Alamofire (~> 4.7.3)
- BigInt (~> 3.1.0)
- Cuckoo
- HSCryptoKit
- HSHDWalletKit (~> 1.0.1)
- ObjectMapper
- RealmSwift
- RxRealm
- RxSwift
- HSCryptoKit (~> 1.0.1)
- HSHDWalletKit (~> 1.0.2)
- ObjectMapper (~> 3.3.0)
- RealmSwift (~> 3.11.0)
- RxRealm (~> 0.7.5)
- RxSwift (~> 4.3.1)

SPEC REPOS:
https://github.com/cocoapods/specs.git:
Expand All @@ -47,15 +47,15 @@ SPEC CHECKSUMS:
Alamofire: c7287b6e5d7da964a70935e5db17046b7fde6568
BigInt: 76b5dfdfa3e2e478d4ffdf161aeede5502e2742f
Cuckoo: 97522dd7ac6f18adba6022bdc74aa69e82ca691a
HSCryptoKit: 03c84aca081a6bcc999021d0acbf0cf7cf785d34
HSHDWalletKit: b3207ba91c73e32905964b36a0faf5c1da287cdd
HSCryptoKit: b5b7080a6571df88e25e68ec7dcc1c02a56f02ee
HSHDWalletKit: a37ff1172876560ded7d5ddedfe7e53959825658
ObjectMapper: b612bf8c8e99c4dc0bb6013a51f7c27966ed5da9
Realm: 92f09a102692b96a9a10e9617f214f15c5ab85fc
RealmSwift: 5f0481cd658bb751c509314b964a35eaa264d2cf
RxRealm: a6c6c0a07cb61f34209969ca6657734edfdfff30
RxSwift: fe0fd770a43acdb7d0a53da411c9b892e69bb6e4
SipHash: fad90a4683e420c52ef28063063dbbce248ea6d4

PODFILE CHECKSUM: 80f4ef001bd51248b6aad22c6bea2e8e94911d81
PODFILE CHECKSUM: 4dfd6262a08f389382d5333fe927a2d78324dcdc

COCOAPODS: 1.5.3

0 comments on commit b177338

Please sign in to comment.