Skip to content

Commit

Permalink
enable 0 quota
Browse files Browse the repository at this point in the history
  • Loading branch information
area363 committed Feb 16, 2024
1 parent 324e3cc commit 3e57fe5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Lib9c.Policy/NCStagePolicy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class NCStagePolicy : IStagePolicy

public NCStagePolicy(TimeSpan txLifeTime, int quotaPerSigner, IAccessControlService? accessControlService = null)
{
if (quotaPerSigner < 1)
if (quotaPerSigner < 0)
{
throw new ArgumentOutOfRangeException(
$"{nameof(quotaPerSigner)} must be positive: ${quotaPerSigner}");
Expand Down Expand Up @@ -106,6 +106,13 @@ public bool Stage(BlockChain blockChain, Transaction transaction)
return false;
}
}
else
{
if (_quotaPerSigner < 1)
{
return false;
}
}

var deniedTxs = new[]
{
Expand Down

0 comments on commit 3e57fe5

Please sign in to comment.