Skip to content

Commit

Permalink
[FAB-4512] Add leader log entry in gossip
Browse files Browse the repository at this point in the history
This commit adds a logging entry that specifies if the peer
is going to fetch blocks from the ordering service, or to abort
doing so.

Change-Id: I3d2fcd97e57f67e01ab9dacf52aed22e6f296ee9
Signed-off-by: Yacov Manevich <yacovm@il.ibm.com>
  • Loading branch information
yacovm committed Jun 12, 2017
1 parent 307c903 commit 6156ea8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gossip/service/gossip_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,12 @@ func (g *gossipServiceImpl) amIinChannel(myOrg string, config Config) bool {
func (g *gossipServiceImpl) onStatusChangeFactory(chainID string, committer blocksprovider.LedgerInfo) func(bool) {
return func(isLeader bool) {
if isLeader {
logger.Info("Elected as a leader, starting delivery service for channel", chainID)
if err := g.deliveryService.StartDeliverForChannel(chainID, committer); err != nil {
logger.Error("Delivery service is not able to start blocks delivery for chain, due to", err)
}
} else {
logger.Info("Renounced leadership, stopping delivery service for channel", chainID)
if err := g.deliveryService.StopDeliverForChannel(chainID); err != nil {
logger.Error("Delivery service is not able to stop blocks delivery for chain, due to", err)
}
Expand Down

0 comments on commit 6156ea8

Please sign in to comment.