From af635cdc0dec829284457d81bd57f8fb910e3d92 Mon Sep 17 00:00:00 2001 From: Kukks Date: Mon, 8 Nov 2021 08:14:49 +0100 Subject: [PATCH] Fix: Amount validation for payout creation min amount was missing --- BTCPayServer/HostedServices/PullPaymentHostedService.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/BTCPayServer/HostedServices/PullPaymentHostedService.cs b/BTCPayServer/HostedServices/PullPaymentHostedService.cs index 749e3b5a8..cc15689b0 100644 --- a/BTCPayServer/HostedServices/PullPaymentHostedService.cs +++ b/BTCPayServer/HostedServices/PullPaymentHostedService.cs @@ -391,6 +391,14 @@ namespace BTCPayServer.HostedServices } } + if (req.ClaimRequest.Value < + await payoutHandler.GetMinimumPayoutAmount(req.ClaimRequest.PaymentMethodId, + req.ClaimRequest.Destination)) + { + req.Completion.TrySetResult(new ClaimRequest.ClaimResponse(ClaimRequest.ClaimResult.AmountTooLow)); + return; + } + var payouts = (await ctx.Payouts.GetPayoutInPeriod(pp, now) .Where(p => p.State != PayoutState.Cancelled) .ToListAsync())