github.com/hechain20/hechain@v0.0.0-20220316014945-b544036ba106/orderer/consensus/inactive/inactive_chain.go (about) 1 /* 2 Copyright hechain. 2017 All Rights Reserved. 3 4 SPDX-License-Identifier: Apache-2.0 5 */ 6 7 package inactive 8 9 import ( 10 "github.com/hechain20/hechain/orderer/common/types" 11 "github.com/hyperledger/fabric-protos-go/common" 12 ) 13 14 // Chain implements an inactive consenter.Chain 15 // which is used to denote that the current orderer node 16 // does not service a specific channel. 17 type Chain struct { 18 Err error 19 } 20 21 func (c *Chain) Order(_ *common.Envelope, _ uint64) error { 22 return c.Err 23 } 24 25 func (c *Chain) Configure(_ *common.Envelope, _ uint64) error { 26 return c.Err 27 } 28 29 func (c *Chain) WaitReady() error { 30 return c.Err 31 } 32 33 func (*Chain) Errored() <-chan struct{} { 34 closedChannel := make(chan struct{}) 35 close(closedChannel) 36 return closedChannel 37 } 38 39 func (c *Chain) Start() { 40 } 41 42 func (c *Chain) Halt() { 43 } 44 45 // StatusReport returns the ConsensusRelation & Status 46 func (c *Chain) StatusReport() (types.ConsensusRelation, types.Status) { 47 return types.ConsensusRelationConfigTracker, types.StatusInactive 48 }