SatSale

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit f8edcc93607111a6f647207181400ffd9ec98c08
parent cd7e82b757c6beca4c39f032ac55a7a344829b79
Author: nickfarrow <nicholas.w.farrow@gmail.com>
Date:   Tue,  9 Nov 2021 02:25:22 +1100

Reimplement macaroon setting, `invoice.macaroon` by default for security

Diffstat:
Mconfig.py | 3++-
Mnode/lnd.py | 10+++++-----
2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/config.py b/config.py @@ -40,8 +40,9 @@ pay_method = "bitcoind" # To find (or copy from remote nodes) the macaroon and TLS certs #lnd_dir = "~/.lnd/" -# lnd RPC port (uncomment) +# lnd RPC port and lnd macaroon (uncomment) #lnd_rpcport = "10009" +#lnd_macaroon = "invoice.macaroon" # Check for payment every xx seconds diff --git a/node/lnd.py b/node/lnd.py @@ -69,20 +69,20 @@ class lnd: # Copy tls and macaroon certs from remote machine. def copy_certs(self): - self.certs = {"tls": "tls.cert", "macaroon": "admin.macaroon"} + self.certs = {"tls": "tls.cert", "macaroon": config.lnd_macaroon} - if (not os.path.isfile("tls.cert")) or (not os.path.isfile("admin.macaroon")): + if (not os.path.isfile("tls.cert")) or (not os.path.isfile(config.lnd_macaroon)): try: tls_file = os.path.join(config.lnd_dir, "tls.cert") macaroon_file = os.path.join( - config.lnd_dir, "data/chain/bitcoin/mainnet/admin.macaroon" + config.lnd_dir, "data/chain/bitcoin/mainnet/{}".format(config.lnd_macaroon) ) # SSH copy if config.tunnel_host is not None: print( - "Could not find tls.cert or admin.macaroon in SatSale folder. \ - Attempting to download from remote lnd directory." + "Could not find tls.cert or {} in SatSale folder. \ + Attempting to download from remote lnd directory.".format(config.lnd_macaroon) ) subprocess.run(