sort coins in genesis

This commit is contained in:
Ethan Buchman
2018-04-05 14:55:10 +03:00
parent e0d043b342
commit 9b5babba81
4 changed files with 60 additions and 5 deletions
+4 -1
View File
@@ -257,7 +257,10 @@ func (coins Coins) Swap(i, j int) { coins[i], coins[j] = coins[j], coins[i]
var _ sort.Interface = Coins{}
// Sort is a helper function to sort the set of coins inplace
func (coins Coins) Sort() { sort.Sort(coins) }
func (coins Coins) Sort() Coins {
sort.Sort(coins)
return coins
}
//----------------------------------------
// Parsing