Disable withdraw
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-02-13 15:06:09 +00:00
parent 269e3353f3
commit 1799a90341

View File

@ -86,6 +86,8 @@ public class UserService
var user = await GetUser(pubkey); var user = await GetUser(pubkey);
if (user == default) throw new Exception("No user found"); if (user == default) throw new Exception("No user found");
if (!user.IsAdmin) throw new Exception("Withdrawal disabled");
var maxOut = await MaxWithdrawalAmount(pubkey); var maxOut = await MaxWithdrawalAmount(pubkey);
var pr = BOLT11PaymentRequest.Parse(invoice, invoice.StartsWith("lnbc") ? Network.Main : Network.RegTest); var pr = BOLT11PaymentRequest.Parse(invoice, invoice.StartsWith("lnbc") ? Network.Main : Network.RegTest);
if (pr.MinimumAmount == 0) if (pr.MinimumAmount == 0)