func (b *BlockChain) CheckLiveTickets(hashes []chainhash.Hash) []bool {
	b.chainLock.RLock()
	sn := b.bestNode.stakeNode
	b.chainLock.RUnlock()
	existsSlice := make([]bool, len(hashes))
	for i := range hashes {
		existsSlice[i] = sn.ExistsLiveTicket(hashes[i])
	}
	return existsSlice
}
CheckLiveTickets returns whether or not a slice of tickets exist in the live
ticket treap of the best node.

This function is safe for concurrent access.
package blockchain
import (
	"github.com/HcashOrg/hcashd/chaincfg/chainhash"
	"github.com/HcashOrg/hcashd/database"
	"github.com/HcashOrg/hcashd/txscript"
	"github.com/HcashOrg/hcashutil"
)
func (b *BlockChain) NextLotteryData() ([]chainhash.Hash, int, [6]byte, error) {
	b.chainLock.RLock()
	defer b.chainLock.RUnlock()
	return b.bestNode.stakeNode.Winners(), b.bestNode.stakeNode.PoolSize(),
		b.bestNode.stakeNode.FinalState(), nil
}
func (b *BlockChain) lotteryDataForNode(node *blockNode) ([]chainhash.Hash, int, [6]byte, error) {
	if node.keyHeight < b.chainParams.StakeEnabledHeight {
		return []chainhash.Hash{}, 0, [6]byte{}, nil
	}
	stakeNode, err := b.fetchStakeNode(node)
	if err != nil {
		return []chainhash.Hash{}, 0, [6]byte{}, err
	}
	return stakeNode.Winners(), b.bestNode.stakeNode.PoolSize(),
		b.bestNode.stakeNode.FinalState(), nil
}
func (b *BlockChain) lotteryDataForBlock(hash *chainhash.Hash) ([]chainhash.Hash, int, [6]byte, error) {
	var node *blockNode
	if n, exists := b.index[*hash]; exists {
		node = n
	} else {
		var err error
		node, err = b.findNode(hash, maxSearchDepth)
		if err != nil {
			return nil, 0, [6]byte{}, err
		}
	}
	winningTickets, poolSize, finalState, err := b.lotteryDataForNode(node)
	if err != nil {
		return nil, 0, [6]byte{}, err
	}
	return winningTickets, poolSize, finalState, nil
}
func (b *BlockChain) LotteryDataForBlock(hash *chainhash.Hash) ([]chainhash.Hash, int, [6]byte, error) {
	b.chainLock.Lock()
	defer b.chainLock.Unlock()
	return b.lotteryDataForBlock(hash)
}
func (b *BlockChain) LiveTickets() ([]chainhash.Hash, error) {
	b.chainLock.RLock()
	sn := b.bestNode.stakeNode
	b.chainLock.RUnlock()
	return sn.LiveTickets(), nil
}
func (b *BlockChain) MissedTickets() ([]chainhash.Hash, error) {
	b.chainLock.RLock()
	sn := b.bestNode.stakeNode
	b.chainLock.RUnlock()
	return sn.MissedTickets(), nil
}
func (b *BlockChain) TicketsWithAddress(address hcashutil.Address) ([]chainhash.Hash, error) {
	b.chainLock.RLock()
	sn := b.bestNode.stakeNode
	b.chainLock.RUnlock()
	tickets := sn.LiveTickets()
	var ticketsWithAddr []chainhash.Hash
	err := b.db.View(func(dbTx database.Tx) error {
		for _, hash := range tickets {
			utxo, err := dbFetchUtxoEntry(dbTx, &hash)
			if err != nil {
				return err
			}
			_, addrs, _, err :=
				txscript.ExtractPkScriptAddrs(txscript.DefaultScriptVersion,
					utxo.PkScriptByIndex(0), b.chainParams)
			if err != nil {
				return err
			}
			if addrs[0].EncodeAddress() == address.EncodeAddress() {
				ticketsWithAddr = append(ticketsWithAddr, hash)
			}
		}
		return nil
	})
	if err != nil {
		return nil, err
	}
	return ticketsWithAddr, nil
}
func (b *BlockChain) CheckLiveTicket(hash chainhash.Hash) bool {
	b.chainLock.RLock()
	sn := b.bestNode.stakeNode
	b.chainLock.RUnlock()
	return sn.ExistsLiveTicket(hash)
}