Skip to content

Commit

Permalink
[FAB-8066] Delete redundant logger instance
Browse files Browse the repository at this point in the history
The state transfer constructor has a redundant logger instance per
instance, instead of using the package-wide logger reference.

This is confusing and redundant, hence removed.

Change-Id: I1446ee4f1996860c59e1325b5aaf82dd91246d69
Signed-off-by: yacovm <yacovm@il.ibm.com>
yacovm committed Feb 5, 2018
1 parent 15bda58 commit 5f351b0
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions gossip/state/state.go
Original file line number Diff line number Diff line change
@@ -22,7 +22,6 @@ import (
"github.com/hyperledger/fabric/protos/common"
proto "github.com/hyperledger/fabric/protos/gossip"
"github.com/hyperledger/fabric/protos/ledger/rwset"
"github.com/op/go-logging"
"github.com/pkg/errors"
"github.com/spf13/viper"
)
@@ -149,18 +148,12 @@ type GossipStateProviderImpl struct {
stateTransferActive int32
}

var logger *logging.Logger // package-level logger

func init() {
logger = util.GetLogger(util.LoggingStateModule, "")
}
var logger = util.GetLogger(util.LoggingStateModule, "")

// NewGossipStateProvider creates state provider with coordinator instance
// to orchestrate arrival of private rwsets and blocks before committing them into the ledger.
func NewGossipStateProvider(chainID string, services *ServicesMediator, ledger ledgerResources) GossipStateProvider {

logger := util.GetLogger(util.LoggingStateModule, "")

gossipChan, _ := services.Accept(func(message interface{}) bool {
// Get only data messages
return message.(*proto.GossipMessage).IsDataMsg() &&

0 comments on commit 5f351b0

Please sign in to comment.