From 23108bcfc02bfbf73c5782f7e6f260d9e085bdcb Mon Sep 17 00:00:00 2001 From: jiangyaoguo Date: Thu, 1 Sep 2016 11:38:50 +0800 Subject: [PATCH] Remove unused parameter Change-Id: Ic9ec62f4f009b34ad316ea753c46d365371ec401 Signed-off-by: jiangyaoguo --- consensus/helper/handler.go | 5 ++--- core/peer/handler.go | 2 +- core/peer/peer.go | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/consensus/helper/handler.go b/consensus/helper/handler.go index 2ce99e16b69..6d6e62a9167 100644 --- a/consensus/helper/handler.go +++ b/consensus/helper/handler.go @@ -50,10 +50,9 @@ type ConsensusHandler struct { // NewConsensusHandler constructs a new MessageHandler for the plugin. // Is instance of peer.HandlerFactory func NewConsensusHandler(coord peer.MessageHandlerCoordinator, - stream peer.ChatStream, initiatedStream bool, - next peer.MessageHandler) (peer.MessageHandler, error) { + stream peer.ChatStream, initiatedStream bool) (peer.MessageHandler, error) { - peerHandler, err := peer.NewPeerHandler(coord, stream, initiatedStream, nil) + peerHandler, err := peer.NewPeerHandler(coord, stream, initiatedStream) if err != nil { return nil, fmt.Errorf("Error creating PeerHandler: %s", err) } diff --git a/core/peer/handler.go b/core/peer/handler.go index 52d4a558177..ab928589f97 100644 --- a/core/peer/handler.go +++ b/core/peer/handler.go @@ -47,7 +47,7 @@ type Handler struct { // NewPeerHandler returns a new Peer handler // Is instance of HandlerFactory -func NewPeerHandler(coord MessageHandlerCoordinator, stream ChatStream, initiatedStream bool, nextHandler MessageHandler) (MessageHandler, error) { +func NewPeerHandler(coord MessageHandlerCoordinator, stream ChatStream, initiatedStream bool) (MessageHandler, error) { d := &Handler{ ChatStream: stream, diff --git a/core/peer/peer.go b/core/peer/peer.go index a8ec366c9cb..3be5fca8249 100644 --- a/core/peer/peer.go +++ b/core/peer/peer.go @@ -177,7 +177,7 @@ type handlerMap struct { } // HandlerFactory for creating new MessageHandlers -type HandlerFactory func(MessageHandlerCoordinator, ChatStream, bool, MessageHandler) (MessageHandler, error) +type HandlerFactory func(MessageHandlerCoordinator, ChatStream, bool) (MessageHandler, error) // EngineFactory for creating new engines type EngineFactory func(MessageHandlerCoordinator) (Engine, error) @@ -597,7 +597,7 @@ func (p *Impl) chatWithPeer(address string) error { func (p *Impl) handleChat(ctx context.Context, stream ChatStream, initiatedStream bool) error { deadline, ok := ctx.Deadline() peerLogger.Debugf("Current context deadline = %s, ok = %v", deadline, ok) - handler, err := p.handlerFactory(p, stream, initiatedStream, nil) + handler, err := p.handlerFactory(p, stream, initiatedStream) if err != nil { return fmt.Errorf("Error creating handler during handleChat initiation: %s", err) }