func (cs *CoinSet) TotalValue() (value soterutil.Amount) {
	return cs.totalValue
}
TotalValue returns the total value of the coins in the set.
package coinset
import (
	"container/list"
	"errors"
	"sort"
	"github.com/soteria-dag/soterd/chaincfg/chainhash"
	"github.com/soteria-dag/soterd/wire"
	"github.com/soteria-dag/soterd/soterutil"
)
type Coin interface {
	Hash() *chainhash.Hash
	Index() uint32
	Value() soterutil.Amount
	PkScript() []byte
	NumConfs() int64
	ValueAge() int64
}
type Coins interface {
	Coins() []Coin
}
type CoinSet struct {
	coinList      *list.List
	totalValue    soterutil.Amount
	totalValueAge int64
}
var _ Coins = NewCoinSet(nil)
func NewCoinSet(coins []Coin) *CoinSet {
	newCoinSet := &CoinSet{
		coinList:      list.New(),
		totalValue:    0,
		totalValueAge: 0,
	}
	for _, coin := range coins {
		newCoinSet.PushCoin(coin)
	}
	return newCoinSet
}
func (cs *CoinSet) Coins() []Coin {
	coins := make([]Coin, cs.coinList.Len())
	for i, e := 0, cs.coinList.Front(); e != nil; i, e = i+1, e.Next() {
		coins[i] = e.Value.(Coin)
	}
	return coins
}