mirror of
https://github.com/aljazceru/nutshell.git
synced 2025-12-20 18:44:20 +01:00
client sends no amount
This commit is contained in:
@@ -136,7 +136,7 @@ async def pay(ctx, invoice: str):
|
|||||||
print("Error: Balance too low.")
|
print("Error: Balance too low.")
|
||||||
return
|
return
|
||||||
_, send_proofs = await wallet.split_to_send(wallet.proofs, amount)
|
_, send_proofs = await wallet.split_to_send(wallet.proofs, amount)
|
||||||
await wallet.pay_lightning(send_proofs, amount, invoice)
|
await wallet.pay_lightning(send_proofs, invoice)
|
||||||
wallet.status()
|
wallet.status()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -221,8 +221,8 @@ class LedgerAPI:
|
|||||||
|
|
||||||
return return_dict
|
return return_dict
|
||||||
|
|
||||||
async def pay_lightning(self, proofs: List[Proof], amount: int, invoice: str):
|
async def pay_lightning(self, proofs: List[Proof], invoice: str):
|
||||||
payload = MeltRequest(proofs=proofs, amount=amount, invoice=invoice)
|
payload = MeltRequest(proofs=proofs, invoice=invoice)
|
||||||
return_dict = requests.post(
|
return_dict = requests.post(
|
||||||
self.url + "/melt",
|
self.url + "/melt",
|
||||||
json=payload.dict(),
|
json=payload.dict(),
|
||||||
@@ -294,9 +294,9 @@ class Wallet(LedgerAPI):
|
|||||||
await invalidate_proof(proof, db=self.db)
|
await invalidate_proof(proof, db=self.db)
|
||||||
return frst_proofs, scnd_proofs
|
return frst_proofs, scnd_proofs
|
||||||
|
|
||||||
async def pay_lightning(self, proofs: List[Proof], amount: int, invoice: str):
|
async def pay_lightning(self, proofs: List[Proof], invoice: str):
|
||||||
"""Pays a lightning invoice"""
|
"""Pays a lightning invoice"""
|
||||||
status = await super().pay_lightning(proofs, amount, invoice)
|
status = await super().pay_lightning(proofs, invoice)
|
||||||
if status["paid"] == True:
|
if status["paid"] == True:
|
||||||
await self.invalidate(proofs)
|
await self.invalidate(proofs)
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user