Use rpc/client/ws_client; OnStart() returns error

This commit is contained in:
Jae Kwon
2015-08-04 18:44:15 -07:00
parent 3949d3f21d
commit e86073ec96
19 changed files with 112 additions and 97 deletions

View File

@ -8,7 +8,6 @@ import (
"sync"
"time"
"github.com/tendermint/tendermint/wire"
bc "github.com/tendermint/tendermint/blockchain"
. "github.com/tendermint/tendermint/common"
. "github.com/tendermint/tendermint/consensus/types"
@ -16,6 +15,7 @@ import (
"github.com/tendermint/tendermint/p2p"
sm "github.com/tendermint/tendermint/state"
"github.com/tendermint/tendermint/types"
"github.com/tendermint/tendermint/wire"
)
const (
@ -49,13 +49,17 @@ func NewConsensusReactor(consensusState *ConsensusState, blockStore *bc.BlockSto
return conR
}
func (conR *ConsensusReactor) OnStart() {
func (conR *ConsensusReactor) OnStart() error {
log.Notice("ConsensusReactor ", "fastSync", conR.fastSync)
conR.BaseReactor.OnStart()
if !conR.fastSync {
conR.conS.Start()
_, err := conR.conS.Start()
if err != nil {
return err
}
}
go conR.broadcastNewRoundStepRoutine()
return nil
}
func (conR *ConsensusReactor) OnStop() {

View File

@ -158,7 +158,6 @@ import (
"time"
acm "github.com/tendermint/tendermint/account"
"github.com/tendermint/tendermint/wire"
bc "github.com/tendermint/tendermint/blockchain"
. "github.com/tendermint/tendermint/common"
. "github.com/tendermint/tendermint/consensus/types"
@ -166,6 +165,7 @@ import (
mempl "github.com/tendermint/tendermint/mempool"
sm "github.com/tendermint/tendermint/state"
"github.com/tendermint/tendermint/types"
"github.com/tendermint/tendermint/wire"
)
var (
@ -360,9 +360,10 @@ func (cs *ConsensusState) NewStepCh() chan *RoundState {
return cs.newStepCh
}
func (cs *ConsensusState) OnStart() {
func (cs *ConsensusState) OnStart() error {
cs.BaseService.OnStart()
cs.scheduleRound0(cs.Height)
return nil
}
func (cs *ConsensusState) OnStop() {