You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1020 B

  1. package core
  2. import (
  3. "github.com/tendermint/go-p2p"
  4. bc "github.com/tendermint/tendermint/blockchain"
  5. "github.com/tendermint/tendermint/consensus"
  6. mempl "github.com/tendermint/tendermint/mempool"
  7. "github.com/tendermint/tendermint/types"
  8. )
  9. var blockStore *bc.BlockStore
  10. var consensusState *consensus.ConsensusState
  11. var consensusReactor *consensus.ConsensusReactor
  12. var mempoolReactor *mempl.MempoolReactor
  13. var p2pSwitch *p2p.Switch
  14. var privValidator *types.PrivValidator
  15. var genDoc *types.GenesisDoc // cache the genesis structure
  16. func SetBlockStore(bs *bc.BlockStore) {
  17. blockStore = bs
  18. }
  19. func SetConsensusState(cs *consensus.ConsensusState) {
  20. consensusState = cs
  21. }
  22. func SetConsensusReactor(cr *consensus.ConsensusReactor) {
  23. consensusReactor = cr
  24. }
  25. func SetMempoolReactor(mr *mempl.MempoolReactor) {
  26. mempoolReactor = mr
  27. }
  28. func SetSwitch(sw *p2p.Switch) {
  29. p2pSwitch = sw
  30. }
  31. func SetPrivValidator(pv *types.PrivValidator) {
  32. privValidator = pv
  33. }
  34. func SetGenesisDoc(doc *types.GenesisDoc) {
  35. genDoc = doc
  36. }