func (bcR *BlockchainReactor) OnStart() error {
	err := bcR.BaseReactor.OnStart()
	if err != nil {
		return err
	}
	if bcR.fastSync {
		err = bcR.pool.Start()
		if err != nil {
			return err
		}
		go bcR.poolRoutine(false)
	}
	return nil
}
OnStart implements service.Service.
package v0
import (
	"fmt"
	"reflect"
	"time"
	bc "github.com/line/ostracon/blockchain"
	"github.com/line/ostracon/libs/log"
	"github.com/line/ostracon/p2p"
	bcproto "github.com/line/ostracon/proto/ostracon/blockchain"
	sm "github.com/line/ostracon/state"
	"github.com/line/ostracon/store"
	"github.com/line/ostracon/types"
)
const (
	BlockchainChannel = byte(0x40)
	trySyncIntervalMS = 10
	statusUpdateIntervalSeconds = 10
	switchToConsensusIntervalSeconds = 1
)
type consensusReactor interface {
	SwitchToConsensus(state sm.State, skipWAL bool)
}
type peerError struct {
	err    error
	peerID p2p.ID
}
func (e peerError) Error() string {
	return fmt.Sprintf("error with peer %v: %s", e.peerID, e.err.Error())
}
type BlockchainReactor struct {
	p2p.BaseReactor
	initialState sm.State
	blockExec *sm.BlockExecutor
	store     *store.BlockStore
	pool      *BlockPool
	fastSync  bool
	requestsCh <-chan BlockRequest
	errorsCh   <-chan peerError
}
func NewBlockchainReactor(state sm.State, blockExec *sm.BlockExecutor, store *store.BlockStore,
	fastSync bool, async bool, recvBufSize int) *BlockchainReactor {
	if state.LastBlockHeight != store.Height() {
		panic(fmt.Sprintf("state (%v) and store (%v) height mismatch", state.LastBlockHeight,
			store.Height()))
	}
	requestsCh := make(chan BlockRequest, maxTotalRequesters)
	const capacity = 1000                       
	errorsCh := make(chan peerError, capacity)  
	startHeight := store.Height() + 1
	if startHeight == 1 {
		startHeight = state.InitialHeight
	}
	pool := NewBlockPool(startHeight, requestsCh, errorsCh)
	bcR := &BlockchainReactor{
		initialState: state,
		blockExec:    blockExec,
		store:        store,
		pool:         pool,
		fastSync:     fastSync,
		requestsCh:   requestsCh,
		errorsCh:     errorsCh,
	}
	bcR.BaseReactor = *p2p.NewBaseReactor("BlockchainReactor", bcR, async, recvBufSize)
	return bcR
}
func (bcR *BlockchainReactor) SetLogger(l log.Logger) {
	bcR.BaseService.Logger = l
	bcR.pool.Logger = l
}