Skip to content

Commit

Permalink
Ensure PoW correct order for TXs tiebreakers (neo-project#38)
Browse files Browse the repository at this point in the history
* Ensure PoW correct order for TXs tiebreakers

* ThenByAscending for Hash
  • Loading branch information
vncoelho authored and 陈志同 committed Oct 13, 2020
1 parent 529ee0a commit 731bb64
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions SimplePolicy/SimplePolicyPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,14 @@ private static IEnumerable<Transaction> FilterForBlock_Policy2(IEnumerable<Trans
.OrderByDescending(p => p.NetworkFee / p.Size)
.ThenByDescending(p => p.NetworkFee)
.ThenByDescending(p => InHighPriorityList(p))
.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)
.ThenByAscending(p => p.Transaction.Hash)
.Take(Settings.Default.MaxTransactionsPerBlock - free.Length - 1)
.ToArray();

Expand Down

0 comments on commit 731bb64

Please sign in to comment.