mirror of
https://github.com/aljazceru/nutshell.git
synced 2026-01-06 18:34:20 +01:00
check Lightning
This commit is contained in:
@@ -29,7 +29,7 @@ pip install cashu
|
|||||||
|
|
||||||
To update Cashu, use `pip install cashu -U`.
|
To update Cashu, use `pip install cashu -U`.
|
||||||
|
|
||||||
If you have problems running the command above on Ubuntu, run `sudo apt install -y pip pkg-config libpq-dev`. On macOS, run `brew install postgresql`.
|
If you have problems running the command above on Ubuntu, run `sudo apt install -y pip pkg-config`.
|
||||||
|
|
||||||
You can skip the entire next section about Poetry and jump right to [Using Cashu](#using-cashu).
|
You can skip the entire next section about Poetry and jump right to [Using Cashu](#using-cashu).
|
||||||
|
|
||||||
|
|||||||
@@ -237,10 +237,13 @@ class Ledger:
|
|||||||
async def mint(self, B_s: List[PublicKey], amounts: List[int], payment_hash=None):
|
async def mint(self, B_s: List[PublicKey], amounts: List[int], payment_hash=None):
|
||||||
"""Mints a promise for coins for B_."""
|
"""Mints a promise for coins for B_."""
|
||||||
# check if lightning invoice was paid
|
# check if lightning invoice was paid
|
||||||
if LIGHTNING and (
|
if LIGHTNING:
|
||||||
payment_hash and not await self._check_lightning_invoice(payment_hash)
|
try:
|
||||||
):
|
paid = await self._check_lightning_invoice(payment_hash)
|
||||||
raise Exception("Lightning invoice not paid yet.")
|
except:
|
||||||
|
raise Exception("could not check invoice.")
|
||||||
|
if not paid:
|
||||||
|
raise Exception("Lightning invoice not paid yet.")
|
||||||
|
|
||||||
for amount in amounts:
|
for amount in amounts:
|
||||||
if amount not in [2**i for i in range(MAX_ORDER)]:
|
if amount not in [2**i for i in range(MAX_ORDER)]:
|
||||||
|
|||||||
Reference in New Issue
Block a user