Browse Source

comment Txs sort

pull/8094/head
William Banfield 3 years ago
parent
commit
235a636af2
No known key found for this signature in database GPG Key ID: EFAD3442BF29E3AC
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      types/tx.go

+ 2
- 0
types/tx.go View File

@ -63,6 +63,8 @@ func (txs Txs) IndexByHash(hash []byte) int {
return -1
}
// Txs is a slice of transactions. Sorting a Txs value orders the transactions
// lexicographically.
func (txs Txs) Len() int { return len(txs) }
func (txs Txs) Swap(i, j int) { txs[i], txs[j] = txs[j], txs[i] }
func (txs Txs) Less(i, j int) bool {


Loading…
Cancel
Save