lnlink

iOS app for connecting to lightning nodes
git clone git://jb55.com/lnlink
Log | Files | Refs | Submodules | README

commit d6a3ca2b992f75f03e1c229702ee1e51861eac56
parent 0a5ef5c9d520d1f485adeff2f5263bb7545baf2c
Author: William Casarin <jb55@jb55.com>
Date:   Fri, 25 Feb 2022 11:53:09 -0800

rpc: simplify connect and init

Signed-off-by: William Casarin <jb55@jb55.com>

Diffstat:
Mlightninglink/RPC.swift | 6+-----
1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/lightninglink/RPC.swift b/lightninglink/RPC.swift @@ -145,14 +145,10 @@ public func performRpcOnce<IN: Encodable, OUT: Decodable>( let ln = LNSocket() ln.genkey() - guard ln.connect(node_id: node_id, host: host) else { + guard ln.connect_and_init(node_id: node_id, host: host) else { return .failure(RequestError(errorType: .connectionFailed)) } - guard ln.perform_init() else { - return .failure(RequestError(errorType: .initFailed)) - } - return performRpc(ln: ln, operation: operation, authToken: authToken, timeout_ms: timeout_ms, params: params) }