Browse Source

fast sync status

pull/587/head
ramil 8 years ago
parent
commit
6f8d385dfa
5 changed files with 14 additions and 15 deletions
  1. +0
    -5
      blockchain/reactor.go
  2. +5
    -0
      consensus/reactor.go
  3. +1
    -1
      node/node.go
  4. +7
    -8
      rpc/core/pipe.go
  5. +1
    -1
      rpc/core/status.go

+ 0
- 5
blockchain/reactor.go View File

@ -267,11 +267,6 @@ func (bcR *BlockchainReactor) SetEventSwitch(evsw types.EventSwitch) {
bcR.evsw = evsw
}
// FastSync returns whether the blockchain reactor is currently fast syncing
func (bcR *BlockchainReactor) FastSync() bool {
return bcR.fastSync
}
//-----------------------------------------------------------------------------
// Messages


+ 5
- 0
consensus/reactor.go View File

@ -290,6 +290,11 @@ func (conR *ConsensusReactor) SetEventSwitch(evsw types.EventSwitch) {
conR.conS.SetEventSwitch(evsw)
}
// FastSync returns whether the consensus reactor is currently fast syncing
func (conR *ConsensusReactor) FastSync() bool {
return conR.fastSync
}
//--------------------------------------
// Listens for new steps and votes,


+ 1
- 1
node/node.go View File

@ -315,7 +315,7 @@ func (n *Node) ConfigureRPC() {
rpccore.SetAddrBook(n.addrBook)
rpccore.SetProxyAppQuery(n.proxyApp.Query())
rpccore.SetTxIndexer(n.txIndexer)
rpccore.SetBlockchainReactor(n.bcReactor)
rpccore.SetConsensusReactor(n.consensusReactor)
rpccore.SetLogger(n.Logger.With("module", "rpc"))
}


+ 7
- 8
rpc/core/pipe.go View File

@ -2,7 +2,6 @@ package core
import (
crypto "github.com/tendermint/go-crypto"
"github.com/tendermint/tendermint/blockchain"
"github.com/tendermint/tendermint/consensus"
p2p "github.com/tendermint/tendermint/p2p"
"github.com/tendermint/tendermint/proxy"
@ -42,11 +41,11 @@ var (
p2pSwitch P2P
// objects
pubKey crypto.PubKey
genDoc *types.GenesisDoc // cache the genesis structure
addrBook *p2p.AddrBook
txIndexer txindex.TxIndexer
bcReactor *blockchain.BlockchainReactor
pubKey crypto.PubKey
genDoc *types.GenesisDoc // cache the genesis structure
addrBook *p2p.AddrBook
txIndexer txindex.TxIndexer
consensusReactor *consensus.ConsensusReactor
logger log.Logger
)
@ -91,8 +90,8 @@ func SetTxIndexer(indexer txindex.TxIndexer) {
txIndexer = indexer
}
func SetBlockchainReactor(bc *blockchain.BlockchainReactor) {
bcReactor = bc
func SetConsensusReactor(conR *consensus.ConsensusReactor) {
consensusReactor = conR
}
func SetLogger(l log.Logger) {


+ 1
- 1
rpc/core/status.go View File

@ -28,5 +28,5 @@ func Status() (*ctypes.ResultStatus, error) {
LatestAppHash: latestAppHash,
LatestBlockHeight: latestHeight,
LatestBlockTime: latestBlockTime,
Syncing: bcReactor.FastSync()}, nil
Syncing: consensusReactor.FastSync()}, nil
}

Loading…
Cancel
Save