From ee3a86c44b4cd49992f2b5c830fcced60c7bcc0f Mon Sep 17 00:00:00 2001 From: Josh Rickmar Date: Mon, 1 Jun 2015 13:49:15 -0400 Subject: [PATCH] Make listsinceblock block hash optional. Before, calling ListSinceBlock(Async) would create an empty string from the nil block hash. --- wallet.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/wallet.go b/wallet.go index 9327ccbb7..c5e378b6e 100644 --- a/wallet.go +++ b/wallet.go @@ -269,12 +269,12 @@ func (r FutureListSinceBlockResult) Receive() (*btcjson.ListSinceBlockResult, er // // See ListSinceBlock for the blocking version and more details. func (c *Client) ListSinceBlockAsync(blockHash *wire.ShaHash) FutureListSinceBlockResult { - hash := "" + var hash *string if blockHash != nil { - hash = blockHash.String() + hash = btcjson.String(blockHash.String()) } - cmd := btcjson.NewListSinceBlockCmd(&hash, nil, nil) + cmd := btcjson.NewListSinceBlockCmd(hash, nil, nil) return c.sendCmd(cmd) } @@ -293,12 +293,12 @@ func (c *Client) ListSinceBlock(blockHash *wire.ShaHash) (*btcjson.ListSinceBloc // // See ListSinceBlockMinConf for the blocking version and more details. func (c *Client) ListSinceBlockMinConfAsync(blockHash *wire.ShaHash, minConfirms int) FutureListSinceBlockResult { - hash := "" + var hash *string if blockHash != nil { - hash = blockHash.String() + hash = btcjson.String(blockHash.String()) } - cmd := btcjson.NewListSinceBlockCmd(&hash, &minConfirms, nil) + cmd := btcjson.NewListSinceBlockCmd(hash, &minConfirms, nil) return c.sendCmd(cmd) }