diff --git a/core/headerchain.go b/core/headerchain.go index 78ab09cd95..d4522e709b 100644 --- a/core/headerchain.go +++ b/core/headerchain.go @@ -528,3 +528,10 @@ func (hc *HeaderChain) Engine() consensus.Engine { return hc.engine } func (hc *HeaderChain) GetBlock(hash common.Hash, number uint64) *types.Block { return nil } + +// BigIntSlice attaches the methods of sort.Interface to []*big.Int, sorting in increasing order. (used by CalcPastMedianTime) +type BigIntSlice []*big.Int + +func (s BigIntSlice) Len() int { return len(s) } +func (s BigIntSlice) Less(i, j int) bool { return s[i].Cmp(s[j]) < 0 } +func (s BigIntSlice) Swap(i, j int) { s[i], s[j] = s[j], s[i] }