From 66b02e7b77460dcd813351ad6d02a06782e746cf Mon Sep 17 00:00:00 2001 From: Josh Rickmar Date: Thu, 10 Apr 2014 16:43:11 -0500 Subject: [PATCH] Move GetBestBlockResult to btcws. --- rpcclient.go | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/rpcclient.go b/rpcclient.go index eae9327..929e757 100644 --- a/rpcclient.go +++ b/rpcclient.go @@ -291,21 +291,13 @@ func unmarshalNotification(s string) (btcjson.Cmd, error) { return req, nil } -// GetBestBlockResult holds the result of a getbestblock response. -// -// TODO(jrick): shove this in btcws. -type GetBestBlockResult struct { - Hash string `json:"hash"` - Height int32 `json:"height"` -} - // GetBestBlock gets both the block height and hash of the best block // in the main chain. -func GetBestBlock(rpc ServerConn) (*GetBestBlockResult, *btcjson.Error) { +func GetBestBlock(rpc ServerConn) (*btcws.GetBestBlockResult, *btcjson.Error) { cmd := btcws.NewGetBestBlockCmd(<-NewJSONID) response := <-rpc.SendRequest(NewServerRequest(cmd)) - var resultData GetBestBlockResult + var resultData btcws.GetBestBlockResult _, jsonErr := response.FinishUnmarshal(&resultData) if jsonErr != nil { return nil, jsonErr