From 30802fdd524cba2f7259c24917626744a2c8fa62 Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Tue, 31 Dec 2013 15:53:19 -0600 Subject: [PATCH] Rename RPC handlers map to rpcHandlers. The name handlers for a package level is a bit too generic and could easily cause a name collision. Even though the compiler would catch it, use something a bit more descriptive. --- rpcserver.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rpcserver.go b/rpcserver.go index 0a6ea249..8b1facad 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -48,7 +48,7 @@ var ( type commandHandler func(*rpcServer, btcjson.Cmd) (interface{}, error) // handlers maps RPC command strings to appropriate handler functions. -var handlers = map[string]commandHandler{ +var rpcHandlers = map[string]commandHandler{ "addmultisigaddress": handleAskWallet, "addnode": handleAddNode, "backupwallet": handleAskWallet, @@ -382,8 +382,8 @@ func jsonAuthFail(w http.ResponseWriter, r *http.Request, s *rpcServer) { fmt.Fprint(w, "401 Unauthorized.\n") } -// jsonRPCRead is the RPC wrapper around the jsonRead function to handles -// reading and responding to RPC messages. +// jsonRPCRead is the RPC wrapper around the jsonRead function to handle reading +// and responding to RPC messages. func jsonRPCRead(w http.ResponseWriter, r *http.Request, s *rpcServer) { r.Close = true if atomic.LoadInt32(&s.shutdown) != 0 { @@ -1079,7 +1079,7 @@ func standardCmdReply(cmd btcjson.Cmd, s *rpcServer) (reply btcjson.Reply) { id := cmd.Id() reply.Id = &id - handler, ok := handlers[cmd.Method()] + handler, ok := rpcHandlers[cmd.Method()] if !ok { reply.Error = &btcjson.ErrMethodNotFound return reply