mirror of
https://github.com/btcsuite/btcd.git
synced 2024-11-19 18:00:11 +01:00
Make listsinceblock block hash optional.
Before, calling ListSinceBlock(Async) would create an empty string from the nil block hash.
This commit is contained in:
parent
9874580e5b
commit
ee3a86c44b
12
wallet.go
12
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)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user