Skip to content

Commit

Permalink
Remove unused parameter
Browse files Browse the repository at this point in the history
Change-Id: Ic9ec62f4f009b34ad316ea753c46d365371ec401
Signed-off-by: jiangyaoguo <jiangyaoguo@gmail.com>
  • Loading branch information
jiangyaoguo committed Sep 1, 2016
1 parent 0289230 commit 23108bc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions consensus/helper/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion core/peer/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions core/peer/peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit 23108bc

Please sign in to comment.