File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed
Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -182,12 +182,12 @@ public class Kit {
182182
183183 // LocalLnd methods
184184
185- public func start( password: String ) -> Single < Void > {
185+ public func start( password: String ) {
186186 guard let localNode = lndNode as? LocalLnd else {
187- return Single . just ( Void ( ) )
187+ return
188188 }
189189
190- return localNode. startAndUnlock ( password: password)
190+ localNode. startAndUnlock ( password: password)
191191 }
192192
193193 public func create( password: String ) -> Single < [ String ] > {
Original file line number Diff line number Diff line change @@ -5,6 +5,10 @@ import SwiftProtobuf
55class LocalLnd : ILndNode {
66 class NodeNotRetained : Error { }
77
8+ deinit {
9+ LndmobileStopDaemon ( try ! Lnrpc_StopRequest ( ) . serializedData ( ) , VoidResponseCallback ( emitter: nil ) )
10+ }
11+
812 private let filesDir : String
913 private let disposeBag = DisposeBag ( )
1014
@@ -216,18 +220,19 @@ class LocalLnd: ILndNode {
216220 }
217221 }
218222
219- func startAndUnlock( password: String ) -> Single < Void > {
223+ func startAndUnlock( password: String ) {
220224 start ( )
221225 . flatMap { [ weak self] _ in
222226 var request = Lnrpc_UnlockWalletRequest ( )
223227 request. walletPassword = Data ( Array ( password. utf8) )
224228
225229 return self ? . unlockWalletSingle ( request: request) ?? Single . error ( NodeNotRetained ( ) )
226230 }
227- . do (
228- onSuccess: { [ weak self] _ in self ? . scheduleStatusUpdates ( ) } ,
231+ . subscribe (
232+ onSuccess: { [ weak self] in self ? . scheduleStatusUpdates ( ) } ,
229233 onError: { [ weak self] in self ? . status = . error( $0) }
230234 )
235+ . disposed ( by: disposeBag)
231236 }
232237
233238 func createWalletSingle( password: String ) -> Single < [ String ] > {
You can’t perform that action at this time.
0 commit comments