From 5be6e1c92e6b127fb0295d75d4d50dc921892cfc Mon Sep 17 00:00:00 2001 From: "Johan T. Halseth" Date: Mon, 2 Dec 2019 13:26:06 +0100 Subject: [PATCH] mobile: authenticate with rpc server This makes the mobile bindings work with TLS and macaroons enabled, which is supported from falafel 0.6. --- mobile/bindings.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/mobile/bindings.go b/mobile/bindings.go index 7619837a4..0945a17b4 100644 --- a/mobile/bindings.go +++ b/mobile/bindings.go @@ -79,6 +79,19 @@ func Start(extraArgs string, unlockerReady, rpcReady Callback) { go func() { <-rpcListening + + // Now that the RPC server is ready, we can get the needed + // authentication options, and add them to the global dial + // options. + auth, err := lnd.AdminAuthOptions() + if err != nil { + rpcReady.OnError(err) + return + } + + // Add the auth options to the listener's dial options. + addLightningLisDialOption(auth...) + rpcReady.OnResponse([]byte{}) }() }