diff --git a/SimplePolicy/SimplePolicyPlugin.cs b/SimplePolicy/SimplePolicyPlugin.cs index 021ca364c..7aec73d53 100644 --- a/SimplePolicy/SimplePolicyPlugin.cs +++ b/SimplePolicy/SimplePolicyPlugin.cs @@ -50,7 +50,7 @@ public IEnumerable FilterForBlock(IEnumerable transact private static IEnumerable FilterForBlock_Policy1(IEnumerable transactions) { int count = 0, count_free = 0; - foreach (Transaction tx in transactions.OrderByDescending(p => p.NetworkFee / p.Size).ThenByDescending(p => p.NetworkFee).ThenByDescending(p => InHighPriorityList(p))) + foreach (Transaction tx in transactions.OrderByDescending(p => p.NetworkFee / p.Size).ThenByDescending(p => p.NetworkFee).ThenByDescending(p => InHigherLowPriorityList(p))) { if (count++ >= Settings.Default.MaxTransactionsPerBlock - 1) break; if (!tx.IsLowPriority || count_free++ < Settings.Default.MaxFreeTransactionsPerBlock) @@ -66,7 +66,7 @@ private static IEnumerable FilterForBlock_Policy2(IEnumerable p.IsLowPriority) .OrderByDescending(p => p.NetworkFee / p.Size) .ThenByDescending(p => p.NetworkFee) - .ThenByDescending(p => InHighPriorityList(p)) + .ThenByDescending(p => InHigherLowPriorityList(p)) .ThenByAscending(p => p.Transaction.Hash) .Take(Settings.Default.MaxFreeTransactionsPerBlock) .ToArray(); @@ -98,7 +98,7 @@ void ILogPlugin.Log(string source, LogLevel level, string message) private bool VerifySizeLimits(Transaction tx) { - if (InHighPriorityList(tx)) return true; + if (InHigherLowPriorityList(tx)) return true; // Not Allow free TX bigger than MaxFreeTransactionSize if (tx.IsLowPriority && tx.Size > Settings.Default.MaxFreeTransactionSize) return false; @@ -114,6 +114,6 @@ private bool VerifySizeLimits(Transaction tx) } [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static bool InHighPriorityList(Transaction tx) => Settings.Default.HighPriorityTxType.Contains(tx.Type); + public static bool InHigherLowPriorityList(Transaction tx) => Settings.Default.HighPriorityTxType.Contains(tx.Type); } }