1
0
mirror of https://github.com/bumi/lnrpc synced 2025-07-15 15:41:47 +00:00

Only load macaroon if file exists

This commit is contained in:
bumi 2019-05-15 11:38:52 +02:00
parent 7b10b8566d
commit 73e48ba671

View File

@ -40,7 +40,7 @@ module Lnrpc
self.credentials = nil self.credentials = nil
end end
unless options.has_key?(:macaroon) if !options.has_key?(:macaroon) && File.exists?(::File.expand_path(options[:macaroon_path] || DEFAULT_MACAROON_PATH))
options[:macaroon] = ::File.read(::File.expand_path(options[:macaroon_path] || DEFAULT_MACAROON_PATH)).unpack("H*") options[:macaroon] = ::File.read(::File.expand_path(options[:macaroon_path] || DEFAULT_MACAROON_PATH)).unpack("H*")
end end
self.macaroon = options[:macaroon] self.macaroon = options[:macaroon]