From f11e87c957c3951bcedce868d3c8d11b03ac9055 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 13 Apr 2017 20:15:14 -0600 Subject: [PATCH] rpcserver: Fix getcfilterheader RPC method's hex encoding for hash. --- rpcserver.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/rpcserver.go b/rpcserver.go index a7ebf3a9..bbc58061 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -2161,7 +2161,7 @@ func handleGetCFilter(s *rpcServer, cmd interface{}, closeChan <-chan struct{}) rpcsLog.Debugf("Found committed filter for %v", hash) } else { rpcsLog.Debugf("Could not find committed filter for %v: %v", - hash, err) + hash, err) return nil, &btcjson.RPCError{ Code: btcjson.ErrRPCBlockNotFound, Message: "Block not found", @@ -2184,14 +2184,15 @@ func handleGetCFilterHeader(s *rpcServer, cmd interface{}, closeChan <-chan stru rpcsLog.Debugf("Found header of committed filter for %v", hash) } else { rpcsLog.Debugf("Could not find header of committed filter for %v: %v", - hash, err) + hash, err) return nil, &btcjson.RPCError{ Code: btcjson.ErrRPCBlockNotFound, Message: "Block not found", } } - return hex.EncodeToString(headerBytes), nil + hash.SetBytes(headerBytes) + return hash.String(), nil } // handleGetConnectionCount implements the getconnectioncount command.