Silence initialization of nick generator

This commit is contained in:
Reckless_Satoshi 2022-01-18 12:52:10 -08:00
parent a0b38d831f
commit 7a6c29fe64
No known key found for this signature in database
GPG Key ID: 9C4585B561315571
2 changed files with 16 additions and 11 deletions

View File

@ -60,11 +60,15 @@ class Command(BaseCommand):
response = stub.LookupInvoiceV2(request, metadata=[('macaroon', MACAROON.hex())])
hold_lnpayment.status = lnd_state_to_lnpayment_status[response.state]
except Exception as e:
# If it fails at finding the invoice it has been canceled.
# On RoboSats DB we make a distinction between cancelled and returned (LND does not)
except Exception as e:
if 'unable to locate invoice' in str(e):
hold_lnpayment.status = LNPayment.Status.CANCEL
# LND restarted.
if 'wallet locked, unlock it to enable full RPC access' in str(e):
self.stdout.write(str(timezone.now())+':: Wallet Locked')
# Other write to logs
else:
self.stdout.write(str(e))
@ -121,7 +125,7 @@ class Command(BaseCommand):
except Exception as e:
self.stdout.write(str(e))
# TODO If an lnpayment goes from LOCKED to INVGED. Totally weird
# TODO If a lnpayment goes from LOCKED to INVGED. Totally weird
# halt the order
if lnpayment.status == LNPayment.Status.LOCKED:
pass

View File

@ -41,6 +41,7 @@ class NickGenerator:
else:
raise ValueError("Language not implemented.")
if verbose:
print(
f"{lang} SHA256 Nick Generator initialized with:"
+ f"\nUp to {len(adverbs)} adverbs."