callebtc / callebtc/nutshell-lnurl

Risk of deleting paid invoice before issuing ecash

Open
#2 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

The follwing code seems to check for invoice expiry and deltes the invoice if expired before checking if it has been paid. If the code runs periodically every n seconds and if the invoice has been paid AND expired within last n seconds round, the code likely deletes it before redeeming ecash.

```
if time.time() - invoice.created > 60 * 60:
del invoices[invoice.invoice.id]
store_invoices()
logger.warning(
f"Invoice {invoice.invoice.id} has exceeded timeout. Deleting."
)
return
if time.time() - invoice.created > 60:
await asyncio.sleep(30)
else:
await asyncio.sleep(5)

try:
proofs = await wallet.mint(invoice.amount, id=invoice.invoice.id)
logger.success(f"Invoice {invoice.invoice.id} paid!")
paid = True
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Locate the invoice-processing loop containing the expiry deletion and wallet.mint call shown in the issue. Trace how paid invoices are redeemed and deleted, then verify that an invoice paid near expiry is not removed before redemption; the issue provides no test file or named entry point.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
payments
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.