Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set expired dates to invoices #112

Open
qlpqlp opened this issue Sep 10, 2023 · 2 comments
Open

Set expired dates to invoices #112

qlpqlp opened this issue Sep 10, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@qlpqlp
Copy link
Contributor

qlpqlp commented Sep 10, 2023

If in a heavily environment we have 1M > unpaid invoices, GigaWallet will always try to check them all, making things slower

I propose to set an expired date (calculating the Block time in future) per invoice, creating a new field on the invoice table called expired that stores the Dogecoin n Block in the future equivalent to the expire date in the future

futureTime := time.Date(2023, time.September, 13, 0, 0, 0, 0, time.UTC) // invoice expire date/time
timeDifference := futureTime.Sub(time.Now()) // current local time
blocksGenerated := int(timeDifference.Minutes()) * 1 // currently its one Dogecoin Block per minute to calculate how many blocks are generated until the expire date
futureBlockNumber := currentDogecoinBlockNumber + blocksGenerated // we get the future Block Number by calculating

If the n Blocks have passed, on GigaWallet on the invoice table we add a true flag for example on a new field called archive and so GigaWallet will not check any invoice with the flag archive = true

Add an option to "manually" check an archived invoice if wanted, in case some client notifies that made a payment after the expiration date.

@qlpqlp qlpqlp added the enhancement New feature or request label Sep 10, 2023
@raffecat
Copy link
Contributor

GigaWallet will always try to check them all, making things slower

This is not actually the case. Gigawallet currently checks all invoices the belong to an affected account, after an account is affected by blockchain activity in a new block. If the new block doesn't affect an account, none of its invoices will be checked.

This might be a problem for anyone using a single account and issuing millions of invoices from the same account.

@qlpqlp
Copy link
Contributor Author

qlpqlp commented Sep 11, 2023

This might be a problem for anyone using a single account and issuing millions of invoices from the same account.

wow :)

sorry the duplicates, I have to check them more often lol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants