busyboredom / acceptxmr

A monero payment gateway library
Apache License 2.0
72 stars 5 forks source link

invoice.expiration_in() equals the expiry block rather than the amount of blocks until expiry #54

Closed ogcatt closed 1 year ago

ogcatt commented 1 year ago

It does this until the invoice is queried again and it corrects itself. For example, I set expiry to 250 blocks, and .expiration_in() was 2867261 while creation_height was 2867011.

After using .expiration_in() function a second time, its value was set to 250.

busyboredom commented 1 year ago

Thanks for making this issue!

I was able to reproduce this by making the first expiration_in() call before any new blocks have arrived. Definitely counterintuitive behavior. Looks like it should be an easy fix though

busyboredom commented 1 year ago

The fix is on master, so you can point your project at latest master for now and I'll get this out in the next patch release.

ogcatt commented 1 year ago

Great 🫡