Documentation ¶
Index ¶
- func Close()
- func DisplayCoinMap(cm *CoinsMap)
- func InitUtxoLruTip(uc *UtxoConfig)
- type CacheView
- type Coin
- func (coin *Coin) Clear()
- func (coin *Coin) DeepCopy() *Coin
- func (coin *Coin) DynamicMemoryUsage() int64
- func (coin *Coin) GetAmount() amount.Amount
- func (coin *Coin) GetHeight() int32
- func (coin *Coin) GetScriptPubKey() *script.Script
- func (coin *Coin) GetTxOut() txout.TxOut
- func (coin *Coin) IsCoinBase() bool
- func (coin *Coin) IsMempoolCoin() bool
- func (coin *Coin) IsSpendable() bool
- func (coin *Coin) IsSpent() bool
- func (coin *Coin) Serialize(w io.Writer) error
- func (coin *Coin) Unserialize(r io.Reader) error
- type CoinKey
- type CoinsDB
- func (coinsViewDB *CoinsDB) BatchWrite(cm map[outpoint.OutPoint]*Coin, hashBlock util.Hash) error
- func (coinsViewDB *CoinsDB) EstimateSize() uint64
- func (coinsViewDB *CoinsDB) GetBestBlock() (*util.Hash, error)
- func (coinsViewDB *CoinsDB) GetCoin(outpoint *outpoint.OutPoint) (*Coin, error)
- func (coinsViewDB *CoinsDB) GetDBW() *db.DBWrapper
- func (coinsViewDB *CoinsDB) HaveCoin(outpoint *outpoint.OutPoint) bool
- type CoinsLruCache
- func (coinsCache *CoinsLruCache) DynamicMemoryUsage() int64
- func (coinsCache *CoinsLruCache) Flush() bool
- func (coinsCache *CoinsLruCache) GetBestBlock() (util.Hash, error)
- func (coinsCache *CoinsLruCache) GetCacheSize() int
- func (coinsCache *CoinsLruCache) GetCoin(outpoint *outpoint.OutPoint) *Coin
- func (coinsCache *CoinsLruCache) GetCoinsDB() CoinsDB
- func (coinsCache *CoinsLruCache) HaveCoin(point *outpoint.OutPoint) bool
- func (coinsCache *CoinsLruCache) RemoveCoins(point *outpoint.OutPoint)
- func (coinsCache *CoinsLruCache) UpdateCoins(cm *CoinsMap, hash *util.Hash) error
- type CoinsMap
- func (cm *CoinsMap) AccessCoin(outpoint *outpoint.OutPoint) *Coin
- func (cm *CoinsMap) AddCoin(point *outpoint.OutPoint, coin *Coin, possibleOverwrite bool)
- func (cm *CoinsMap) DeepCopy() *CoinsMap
- func (cm *CoinsMap) FetchCoin(out *outpoint.OutPoint) *Coin
- func (cm *CoinsMap) Flush(hashBlock util.Hash) bool
- func (cm *CoinsMap) GetCoin(outpoint *outpoint.OutPoint) *Coin
- func (cm *CoinsMap) GetMap() map[outpoint.OutPoint]*Coin
- func (cm *CoinsMap) GetValueIn(txn *tx.Tx) amount.Amount
- func (cm *CoinsMap) SpendCoin(point *outpoint.OutPoint) *Coin
- func (cm *CoinsMap) SpendGlobalCoin(out *outpoint.OutPoint) *Coin
- func (cm *CoinsMap) UnCache(point *outpoint.OutPoint)
- type UtxoConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Close ¶ added in v0.0.3
func Close()
Close FIXME: this is only for test. We must do it in a graceful way
func DisplayCoinMap ¶
func DisplayCoinMap(cm *CoinsMap)
func InitUtxoLruTip ¶
func InitUtxoLruTip(uc *UtxoConfig)
Types ¶
type CacheView ¶
type CacheView interface { GetCoin(outpoint *outpoint.OutPoint) *Coin HaveCoin(point *outpoint.OutPoint) bool GetBestBlock() (util.Hash, error) UpdateCoins(tempCacheCoins *CoinsMap, hash *util.Hash) error DynamicMemoryUsage() int64 GetCacheSize() int RemoveCoins(outpoint *outpoint.OutPoint) Flush() bool }
func GetUtxoCacheInstance ¶
func GetUtxoCacheInstance() CacheView
type Coin ¶
type Coin struct {
// contains filtered or unexported fields
}
func NewEmptyCoin ¶
func NewEmptyCoin() *Coin
func NewFreshCoin ¶ added in v0.0.3
NewFreshCoin creates an confirmed coin
func NewFreshEmptyCoin ¶ added in v0.0.3
func NewFreshEmptyCoin() *Coin
func NewMempoolCoin ¶
NewMempoolCoin creates an unconfirmed coin for mempool
func (*Coin) DynamicMemoryUsage ¶
func (*Coin) GetScriptPubKey ¶
func (*Coin) IsCoinBase ¶
func (*Coin) IsMempoolCoin ¶
func (*Coin) IsSpendable ¶
type CoinsDB ¶
type CoinsDB struct {
// contains filtered or unexported fields
}
func (*CoinsDB) BatchWrite ¶
func (*CoinsDB) EstimateSize ¶
type CoinsLruCache ¶
type CoinsLruCache struct {
// contains filtered or unexported fields
}
func (*CoinsLruCache) DynamicMemoryUsage ¶
func (coinsCache *CoinsLruCache) DynamicMemoryUsage() int64
func (*CoinsLruCache) Flush ¶
func (coinsCache *CoinsLruCache) Flush() bool
func (*CoinsLruCache) GetBestBlock ¶
func (coinsCache *CoinsLruCache) GetBestBlock() (util.Hash, error)
func (*CoinsLruCache) GetCacheSize ¶
func (coinsCache *CoinsLruCache) GetCacheSize() int
func (*CoinsLruCache) GetCoin ¶
func (coinsCache *CoinsLruCache) GetCoin(outpoint *outpoint.OutPoint) *Coin
func (*CoinsLruCache) GetCoinsDB ¶
func (coinsCache *CoinsLruCache) GetCoinsDB() CoinsDB
func (*CoinsLruCache) HaveCoin ¶
func (coinsCache *CoinsLruCache) HaveCoin(point *outpoint.OutPoint) bool
func (*CoinsLruCache) RemoveCoins ¶ added in v0.0.3
func (coinsCache *CoinsLruCache) RemoveCoins(point *outpoint.OutPoint)
func (*CoinsLruCache) UpdateCoins ¶
func (coinsCache *CoinsLruCache) UpdateCoins(cm *CoinsMap, hash *util.Hash) error
type CoinsMap ¶
type CoinsMap struct {
// contains filtered or unexported fields
}
func NewEmptyCoinsMap ¶
func NewEmptyCoinsMap() *CoinsMap
func (*CoinsMap) FetchCoin ¶
FetchCoin different from GetCoin, if not get coin, FetchCoin will get coin from global cache
func (*CoinsMap) GetValueIn ¶ added in v0.0.3
func (*CoinsMap) SpendGlobalCoin ¶
SpendGlobalCoin different from GetCoin, if not get coin, FetchCoin will get coin from global cache
type UtxoConfig ¶
Click to show internal directories.
Click to hide internal directories.