lnbits / withdraw

LNbits Withdraw Extension
MIT License
6 stars 9 forks source link

Fix withdraw increment #26

Closed motorina0 closed 5 months ago

motorina0 commented 5 months ago

Summary

Make sure that increment is called sync for the same withdraw link.

The checking logic has been extracted to _check_withdraw_link. The _check_withdraw_link_safe function makes sure that for one particular withdraw link the check&increment is not atomic.

The NamedLock class holds a dictionary of CounterLocks. When there is now waiter for a lock then the entry is removed from the dictionary.

Note:

dr-erych commented 5 months ago

Oh nice. The change looks very interesting, it might fix a bug we (https://tipcards.io) are experiencing with our currently installed version of the withdraw extension (v0.1.5).

When will v0.1.8 be available for installation in LNbits? (https://raw.githubusercontent.com/lnbits/lnbits-extensions/main/extensions.json)