github.com/Bytom/bytom@v1.1.2-0.20210127130405-ae40204c0b09/mining/sort.go (about)

     1  package mining
     2  
     3  import "github.com/bytom/bytom/protocol"
     4  
     5  type byTime []*protocol.TxDesc
     6  
     7  func (a byTime) Len() int           { return len(a) }
     8  func (a byTime) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
     9  func (a byTime) Less(i, j int) bool { return a[i].Added.Before(a[j].Added) }