Fix: Amount validation for payout creation min amount was missing

This commit is contained in:
Kukks
2021-11-08 08:14:49 +01:00
parent cbf3b3e9ea
commit af635cdc0d

View File

@@ -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())