mirror of https://github.com/bumi/lnrpc
Only load macaroon if file exists
This commit is contained in:
parent
7b10b8566d
commit
73e48ba671
|
@ -40,7 +40,7 @@ module Lnrpc
|
|||
self.credentials = nil
|
||||
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*")
|
||||
end
|
||||
self.macaroon = options[:macaroon]
|
||||
|
|
Loading…
Reference in New Issue