func (h dialHistory) min() pastDial {
	return h[0]
}
Use only these methods to access or modify dialHistory.
package network
import (
	"container/heap"
	"time"
	"github.com/ThinkiumGroup/go-common"
	"github.com/ThinkiumGroup/go-thinkium/network/discover"
)
type (
	expHeap []expItem
	expItem struct {
		item string
		exp  discover.AbsTime
	}
	dialHistory []pastDial
	pastDial struct {
		id  common.NodeID
		exp time.Time
	}
)
func (h *expHeap) nextExpiry() discover.AbsTime {
	return (*h)[0].exp
}
func (h *expHeap) add(item string, exp discover.AbsTime) {
	heap.Push(h, expItem{item, exp})
}
func (h expHeap) contains(item string) bool {
	for _, v := range h {
		if v.item == item {
			return true
		}
	}
	return false
}
func (h *expHeap) expire(now discover.AbsTime, onExp func(string)) {
	for h.Len() > 0 && h.nextExpiry() < now {
		item := heap.Pop(h)
		if onExp != nil {
			onExp(item.(expItem).item)
		}
	}
}
func (h expHeap) Len() int            { return len(h) }
func (h expHeap) Less(i, j int) bool  { return h[i].exp < h[j].exp }
func (h expHeap) Swap(i, j int)       { h[i], h[j] = h[j], h[i] }
func (h *expHeap) Push(x interface{}) { *h = append(*h, x.(expItem)) }
func (h *expHeap) Pop() interface{} {
	old := *h
	n := len(old)
	x := old[n-1]
	*h = old[0 : n-1]
	return x
}