Only load macaroon if file exists

This commit is contained in:
bumi 2019-05-15 11:38:52 +02:00
parent 7b10b8566d
commit 73e48ba671
1 changed files with 1 additions and 1 deletions

View File

@ -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]