func (blockchain *Blockchain) CurrentState() *state.CheckState {
	blockchain.lock.RLock()
	defer blockchain.lock.RUnlock()
	return blockchain.stateCheck
}
CurrentState returns immutable state of Minter Blockchain
package minter
import (
	"fmt"
	"log"
	"math/big"
	"os"
	"sync/atomic"
	"github.com/MinterTeam/minter-go-node/coreV2/appdb"
	eventsdb "github.com/MinterTeam/minter-go-node/coreV2/events"
	"github.com/MinterTeam/minter-go-node/coreV2/rewards"
	"github.com/MinterTeam/minter-go-node/coreV2/state"
	validators2 "github.com/MinterTeam/minter-go-node/coreV2/state/validators"
	"github.com/MinterTeam/minter-go-node/coreV2/statistics"
	"github.com/MinterTeam/minter-go-node/coreV2/types"
	"github.com/MinterTeam/minter-go-node/coreV2/validators"
	"github.com/syndtr/goleveldb/leveldb/filter"
	"github.com/syndtr/goleveldb/leveldb/opt"
	abciTypes "github.com/tendermint/tendermint/abci/types"
	tmNode "github.com/tendermint/tendermint/node"
	rpc "github.com/tendermint/tendermint/rpc/client/local"
)
func (blockchain *Blockchain) RpcClient() *rpc.Local {
	return blockchain.rpcClient
}
func (blockchain *Blockchain) RewardCounter() *rewards.Reward {
	return blockchain.rewardsCounter
}
func (blockchain *Blockchain) InitialHeight() uint64 {
	return blockchain.appDB.GetStartHeight()
}
func (blockchain *Blockchain) checkStop() bool {
	if !blockchain.stopped {
		select {
		case <-blockchain.stopChan.Done():
			blockchain.stop()
		default:
		}
	}
	return blockchain.stopped
}
func (blockchain *Blockchain) stop() {
	blockchain.stopped = true
	if blockchain.tmNode == nil {
		blockchain.Close()
		os.Exit(1)
	} else {
		go func() {
			log.Println("Stopping Node")
			log.Println("Node Stopped with error:", blockchain.tmNode.Stop())
		}()
	}
}
func (blockchain *Blockchain) WaitStop() error {
	defer close(blockchain.stopOk)
	blockchain.tmNode.Wait()
	return blockchain.Close()
}
func (blockchain *Blockchain) calculatePowers(vals []*validators2.Validator) {
	blockchain.validatorsPowers = map[types.Pubkey]*big.Int{}
	blockchain.totalPower = big.NewInt(0)
	for _, val := range vals {
		if val.IsToDrop() || blockchain.GetValidatorStatus(val.GetAddress()) != ValidatorPresent {
			continue
		}
		blockchain.validatorsPowers[val.PubKey] = val.GetTotalBipStake()
		blockchain.totalPower.Add(blockchain.totalPower, val.GetTotalBipStake())
	}
	if blockchain.totalPower.Sign() == 0 {
		blockchain.totalPower = big.NewInt(1)
	}
}
func (blockchain *Blockchain) updateValidators() []abciTypes.ValidatorUpdate {
	height := blockchain.Height()
	blockchain.stateDeliver.Candidates.RecalculateStakes(height)
	valsCount := validators.GetValidatorsCountForBlock(height)
	newCandidates := blockchain.stateDeliver.Candidates.GetNewCandidates(valsCount)
	if len(newCandidates) < valsCount {
		valsCount = len(newCandidates)
	}
	newValidators := make([]abciTypes.ValidatorUpdate, 0, valsCount)
	totalPower := big.NewInt(0)
	for _, candidate := range newCandidates {
		totalPower.Add(totalPower, blockchain.stateDeliver.Candidates.GetTotalStake(candidate.PubKey))
	}
	for _, newCandidate := range newCandidates {
		power := big.NewInt(0).Div(big.NewInt(0).Mul(blockchain.stateDeliver.Candidates.GetTotalStake(newCandidate.PubKey),
			big.NewInt(100000000)), totalPower).Int64()
		if power == 0 {
			power = 1
		}
		newValidators = append(newValidators, abciTypes.Ed25519ValidatorUpdate(newCandidate.PubKey.Bytes(), power))
	}
	blockchain.stateDeliver.Validators.SetNewValidators(newCandidates)
	activeValidators := blockchain.appDB.GetValidators()
	blockchain.appDB.SetValidators(newValidators)
	updates := newValidators
	for _, validator := range activeValidators {
		persisted := false
		for _, newValidator := range newValidators {
			if validator.PubKey.Sum.Compare(newValidator.PubKey.Sum) == 0 {
				persisted = true
				break
			}
		}
		if !persisted {
			updates = append(updates, abciTypes.ValidatorUpdate{
				PubKey: validator.PubKey,
				Power:  0,
			})
		}
	}
	return updates
}