From dabbc4c9de327a9f0389014db7ef65e1efc41b0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vitor=20Naz=C3=A1rio=20Coelho?= Date: Fri, 18 Jan 2019 13:55:46 -0200 Subject: [PATCH 1/2] Ensure PoW correct order for TXs tiebreakers --- SimplePolicy/SimplePolicyPlugin.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SimplePolicy/SimplePolicyPlugin.cs b/SimplePolicy/SimplePolicyPlugin.cs index 432f82191..3057505b3 100644 --- a/SimplePolicy/SimplePolicyPlugin.cs +++ b/SimplePolicy/SimplePolicyPlugin.cs @@ -67,12 +67,14 @@ private static IEnumerable FilterForBlock_Policy2(IEnumerable p.NetworkFee / p.Size) .ThenByDescending(p => p.NetworkFee) .ThenByDescending(p => InHighPriorityList(p)) + .ThenByDescending(p => p.Transaction.Hash) .Take(Settings.Default.MaxFreeTransactionsPerBlock) .ToArray(); Transaction[] non_free = tx_list.Where(p => !p.IsLowPriority) .OrderByDescending(p => p.NetworkFee / p.Size) .ThenByDescending(p => p.NetworkFee) + .ThenByDescending(p => p.Transaction.Hash) .Take(Settings.Default.MaxTransactionsPerBlock - free.Length - 1) .ToArray(); From 72425a8ad085994e031c5fbcfc38fbf9808273f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vitor=20Naz=C3=A1rio=20Coelho?= Date: Fri, 18 Jan 2019 14:10:39 -0200 Subject: [PATCH 2/2] ThenByAscending for Hash --- SimplePolicy/SimplePolicyPlugin.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SimplePolicy/SimplePolicyPlugin.cs b/SimplePolicy/SimplePolicyPlugin.cs index 3057505b3..021ca364c 100644 --- a/SimplePolicy/SimplePolicyPlugin.cs +++ b/SimplePolicy/SimplePolicyPlugin.cs @@ -67,14 +67,14 @@ private static IEnumerable FilterForBlock_Policy2(IEnumerable p.NetworkFee / p.Size) .ThenByDescending(p => p.NetworkFee) .ThenByDescending(p => InHighPriorityList(p)) - .ThenByDescending(p => p.Transaction.Hash) + .ThenByAscending(p => p.Transaction.Hash) .Take(Settings.Default.MaxFreeTransactionsPerBlock) .ToArray(); Transaction[] non_free = tx_list.Where(p => !p.IsLowPriority) .OrderByDescending(p => p.NetworkFee / p.Size) .ThenByDescending(p => p.NetworkFee) - .ThenByDescending(p => p.Transaction.Hash) + .ThenByAscending(p => p.Transaction.Hash) .Take(Settings.Default.MaxTransactionsPerBlock - free.Length - 1) .ToArray();