From 16024636810157d77765e0762457763f04b731a4 Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Thu, 5 Jun 2014 23:57:05 -0500 Subject: [PATCH] Don't split up the group for debuglevel functions. --- extensions.go | 62 +++++++++++++++++++++++++-------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/extensions.go b/extensions.go index eb404a5d..7337e40d 100644 --- a/extensions.go +++ b/extensions.go @@ -36,6 +36,37 @@ func (r FutureDebugLevelResult) Receive() (string, error) { return result, nil } +// DebugLevelAsync returns an instance of a type that can be used to get the +// result of the RPC at some future time by invoking the Receive function on +// the returned instance. +// +// See DebugLevel for the blocking version and more details. +// +// NOTE: This is a btcd extension. +func (c *Client) DebugLevelAsync(levelSpec string) FutureDebugLevelResult { + id := c.NextID() + cmd, err := btcjson.NewDebugLevelCmd(id, levelSpec) + if err != nil { + return newFutureError(err) + } + + return c.sendCmd(cmd) +} + +// DebugLevel dynamically sets the debug logging level to the passed level +// specification. +// +// The levelspec can either a debug level or of the form: +// =,=,... +// +// Additionally, the special keyword 'show' can be used to get a list of the +// available subsystems. +// +// NOTE: This is a btcd extension. +func (c *Client) DebugLevel(levelSpec string) (string, error) { + return c.DebugLevelAsync(levelSpec).Receive() +} + // FutureCreateEncryptedWalletResult is a future promise to deliver the error // result of a CreateEncryptedWalletAsync RPC invocation. type FutureCreateEncryptedWalletResult chan *futureResult @@ -71,37 +102,6 @@ func (c *Client) CreateEncryptedWallet(passphrase string) error { return c.CreateEncryptedWalletAsync(passphrase).Receive() } -// DebugLevelAsync returns an instance of a type that can be used to get the -// result of the RPC at some future time by invoking the Receive function on -// the returned instance. -// -// See DebugLevel for the blocking version and more details. -// -// NOTE: This is a btcd extension. -func (c *Client) DebugLevelAsync(levelSpec string) FutureDebugLevelResult { - id := c.NextID() - cmd, err := btcjson.NewDebugLevelCmd(id, levelSpec) - if err != nil { - return newFutureError(err) - } - - return c.sendCmd(cmd) -} - -// DebugLevel dynamically sets the debug logging level to the passed level -// specification. -// -// The levelspec can either a debug level or of the form: -// =,=,... -// -// Additionally, the special keyword 'show' can be used to get a list of the -// available subsystems. -// -// NOTE: This is a btcd extension. -func (c *Client) DebugLevel(levelSpec string) (string, error) { - return c.DebugLevelAsync(levelSpec).Receive() -} - // FutureListAddressTransactionsResult is a future promise to deliver the result // of a ListAddressTransactionsAsync RPC invocation (or an applicable error). type FutureListAddressTransactionsResult chan *futureResult