diff --git a/Lib9c.Policy/AccessControlService/IAccessControlService.cs b/Lib9c.Policy/AccessControlService/IAccessControlService.cs index 4bbb032430..de601c73c7 100644 --- a/Lib9c.Policy/AccessControlService/IAccessControlService.cs +++ b/Lib9c.Policy/AccessControlService/IAccessControlService.cs @@ -5,5 +5,7 @@ namespace Nekoyume.Blockchain public interface IAccessControlService { public bool IsAccessDenied(Address address); + + public int GetAccessLevel(Address address); } } diff --git a/Lib9c.Policy/NCStagePolicy.cs b/Lib9c.Policy/NCStagePolicy.cs index dec62b5687..ecfb9faba7 100644 --- a/Lib9c.Policy/NCStagePolicy.cs +++ b/Lib9c.Policy/NCStagePolicy.cs @@ -61,7 +61,11 @@ public IEnumerable Iterate(BlockChain blockChain, bool filtered = t s.Add(tx); if (s.Count > _quotaPerSigner) { - s.Remove(s.Max); + var accessLevel = _accessControlService?.GetAccessLevel(tx.Signer); + if (accessLevel <= 0) + { + s.Remove(s.Max); + } } } @@ -77,7 +81,8 @@ public IEnumerable Iterate(BlockChain blockChain, bool filtered = t public bool Stage(BlockChain blockChain, Transaction transaction) { - if (_accessControlService != null && _accessControlService.IsAccessDenied(transaction.Signer)) + var accessLevel = _accessControlService?.GetAccessLevel(transaction.Signer); + if (accessLevel == 0) { return false; }