mirror of
https://github.com/lnbits/lnbits.git
synced 2025-06-13 10:20:51 +02:00
chore: code clean-up
This commit is contained in:
parent
5ffc7185e8
commit
d9746eba94
@ -445,21 +445,19 @@ class StrikeWallet(Wallet):
|
|||||||
) # Calculate request budget based on sleep time.
|
) # Calculate request budget based on sleep time.
|
||||||
processed = 0
|
processed = 0
|
||||||
|
|
||||||
for inv in list(self.pending_invoices): # Iterate through pending invoices.
|
for inv in list(self.pending_invoices):
|
||||||
if processed >= req_budget: # If request budget is exhausted.
|
if processed >= req_budget: # If request budget is exhausted.
|
||||||
break
|
break
|
||||||
status = await self.get_invoice_status(inv) # Get invoice status.
|
status = await self.get_invoice_status(inv)
|
||||||
processed += 1 # Increment processed count.
|
processed += 1
|
||||||
|
|
||||||
if (
|
if (
|
||||||
status.success or status.failed
|
status.success or status.failed
|
||||||
): # If invoice is either successful or failed.
|
):
|
||||||
self.pending_invoices.remove(
|
self.pending_invoices.remove(inv)
|
||||||
inv
|
if status.success:
|
||||||
) # Remove invoice from pending list.
|
had_activity = True
|
||||||
if status.success: # If invoice is successful.
|
yield inv
|
||||||
had_activity = True # Set activity flag.
|
|
||||||
yield inv # Yield the invoice.
|
|
||||||
|
|
||||||
# Dynamic adjustment of polling frequency based on activity.
|
# Dynamic adjustment of polling frequency based on activity.
|
||||||
sleep_s = (
|
sleep_s = (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user