Skip to content

Commit

Permalink
dynamically update quota
Browse files Browse the repository at this point in the history
  • Loading branch information
area363 committed Nov 23, 2023
1 parent 601705b commit e41494c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Lib9c.Policy/NCStagePolicy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,15 @@ public bool Stage(BlockChain blockChain, Transaction transaction)
{
if (_accessControlService?.GetTxQuota(transaction.Signer) is { } acsTxQuota)
{
_quotaPerSignerList.TryAdd(transaction.Signer, acsTxQuota);
if (_quotaPerSignerList.ContainsKey(transaction.Signer))
{
_quotaPerSignerList[transaction.Signer] = acsTxQuota;
}
else
{
_quotaPerSignerList.TryAdd(transaction.Signer, acsTxQuota);
}

if (acsTxQuota == 0)
{
return false;
Expand Down

0 comments on commit e41494c

Please sign in to comment.