We need to check if usescsv is empty. If all uses were consumed, usescsv is just an empty string. In this case, we need to handle it differently. We need to set current_numbers to the last value of uses and also update usescsv accordingly.
If we don't handle this behavior, it won't be possible to update an already used withdraw link to reuse it again.
Fixes: https://github.com/lnbits/withdraw/issues/38
We need to check if
usescsv
is empty. If alluses
were consumed,usescsv
is just an empty string. In this case, we need to handle it differently. We need to setcurrent_numbers
to the last value of uses and also updateusescsv
accordingly.If we don't handle this behavior, it won't be possible to update an already used withdraw link to reuse it again.