Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LndRestWallet: edit warning messages #562

Merged
merged 1 commit into from
Jun 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions cashu/lightning/lndrest.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,19 @@ def __init__(self, unit: Unit = Unit.sat, **kwargs):
)

if not endpoint:
raise Exception("cannot initialize lndrest: no endpoint")
raise Exception("cannot initialize LndRestWallet: no endpoint")

if not macaroon:
raise Exception("cannot initialize lndrest: no macaroon")
raise Exception("cannot initialize LndRestWallet: no macaroon")

if not cert:
logger.warning(
"no certificate for lndrest provided, this only works if you have a"
"no certificate for LndRestWallet provided, this only works if you have a"
" publicly issued certificate"
)

if not cert_verify:
logger.warning(
"certificate validation will be disabled for lndrest"
)

logger.warning("certificate validation will be disabled for LndRestWallet")

endpoint = endpoint[:-1] if endpoint.endswith("/") else endpoint
endpoint = (
Expand All @@ -82,7 +79,6 @@ def __init__(self, unit: Unit = Unit.sat, **kwargs):
if not cert_verify:
self.cert = False


self.auth = {"Grpc-Metadata-macaroon": self.macaroon}
self.client = httpx.AsyncClient(
base_url=self.endpoint, headers=self.auth, verify=self.cert
Expand Down
Loading