cashubtc / cdk

Cashu Development Kit
MIT License
87 stars 44 forks source link

On start up wait invoice returns all paid invoices #430

Open thesimplekid opened 3 weeks ago

thesimplekid commented 3 weeks ago

On start up since we do not pass the wait index to start at wait_any_invoice returns all the invoices that have been paid on the node. We should try and avoid this. And with the addition of bolt 12 we need to make sure we are not adding to the amount thats been paid more then once per real payment.

https://github.com/cashubtc/cdk/blob/4fdc4f49d2ed8ba74b043c163398538d4ec90352/crates/cdk-cln/src/lib.rs#L101-L118

mubarak23 commented 2 weeks ago

so, on startup, we return only unpaid invoice @thesimplekid