rpcserver: Fix getcfilterheader RPC method's hex encoding for hash.

This commit is contained in:
Alex 2017-04-13 20:15:14 -06:00 committed by Olaoluwa Osuntokun
parent 92f1de6dd9
commit f11e87c957

View file

@ -2161,7 +2161,7 @@ func handleGetCFilter(s *rpcServer, cmd interface{}, closeChan <-chan struct{})
rpcsLog.Debugf("Found committed filter for %v", hash) rpcsLog.Debugf("Found committed filter for %v", hash)
} else { } else {
rpcsLog.Debugf("Could not find committed filter for %v: %v", rpcsLog.Debugf("Could not find committed filter for %v: %v",
hash, err) hash, err)
return nil, &btcjson.RPCError{ return nil, &btcjson.RPCError{
Code: btcjson.ErrRPCBlockNotFound, Code: btcjson.ErrRPCBlockNotFound,
Message: "Block not found", 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) rpcsLog.Debugf("Found header of committed filter for %v", hash)
} else { } else {
rpcsLog.Debugf("Could not find header of committed filter for %v: %v", rpcsLog.Debugf("Could not find header of committed filter for %v: %v",
hash, err) hash, err)
return nil, &btcjson.RPCError{ return nil, &btcjson.RPCError{
Code: btcjson.ErrRPCBlockNotFound, Code: btcjson.ErrRPCBlockNotFound,
Message: "Block not found", Message: "Block not found",
} }
} }
return hex.EncodeToString(headerBytes), nil hash.SetBytes(headerBytes)
return hash.String(), nil
} }
// handleGetConnectionCount implements the getconnectioncount command. // handleGetConnectionCount implements the getconnectioncount command.