Skip to content

Commit

Permalink
fix paid_invoice_stream
Browse files Browse the repository at this point in the history
  • Loading branch information
lollerfirst committed Jun 28, 2024
1 parent 145b9a0 commit 36f88af
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cashu/lightning/corelightningrest.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,11 @@ async def get_payment_status(self, checking_id: str) -> PaymentStatus:
async def paid_invoices_stream(self) -> AsyncGenerator[str, None]:
while True:
try:
url = f"{self.url}/v1/waitanyinvoice/{self.last_pay_index}"
async with self.client.stream("POST", url, timeout=None) as r:
url = f"{self.url}/v1/waitanyinvoice"
async with self.client.stream("POST", url, data={
"lastpay_index": self.last_pay_index,
"timeout": None}
) as r:
async for line in r.aiter_lines():
inv = json.loads(line)
if "error" in inv and "message" in inv["error"]:
Expand Down

0 comments on commit 36f88af

Please sign in to comment.