github.com/osdi23p228/fabric@v0.0.0-20221218062954-77808885f5db/orderer/consensus/inactive/inactive_chain.go (about)

     1  /*
     2  Copyright IBM Corp. 2017 All Rights Reserved.
     3  
     4  SPDX-License-Identifier: Apache-2.0
     5  */
     6  
     7  package inactive
     8  
     9  import (
    10  	"github.com/hyperledger/fabric-protos-go/common"
    11  	"github.com/osdi23p228/fabric/orderer/common/types"
    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  
    43  func (c *Chain) Halt() {
    44  
    45  }
    46  
    47  // StatusReport returns the ClusterRelation & Status
    48  func (c *Chain) StatusReport() (types.ClusterRelation, types.Status) {
    49  	return types.ClusterRelationConfigTracker, types.StatusInactive
    50  }