Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RPC] getblock command has been changed #1096

Closed
wenweih opened this issue Dec 12, 2017 · 2 comments
Closed

[RPC] getblock command has been changed #1096

wenweih opened this issue Dec 12, 2017 · 2 comments

Comments

@wenweih
Copy link

wenweih commented Dec 12, 2017

I met the same error as #1088 when call GetBlockVerboseTx method

The getblock command is getblock "blockhash" ( verbosity ) now. the verbosity can be one of the 0, 1, 2 Command: getblock

But in btcd

func (c *Client) GetBlockVerboseTx(blockHash *chainhash.Hash) (*btcjson.GetBlockVerboseResult, error) {
	return c.GetBlockVerboseTxAsync(blockHash).Receive()
}

and the c.GetBlockVerboseTxAsync method is

func (c *Client) GetBlockVerboseTxAsync(blockHash *chainhash.Hash) FutureGetBlockVerboseResult {
	hash := ""
	if blockHash != nil {
		hash = blockHash.String()
	}

	cmd := btcjson.NewGetBlockCmd(hash, btcjson.Bool(true), btcjson.Bool(true))
	return c.sendCmd(cmd)
}

cmd := btcjson.NewGetBlockCmd(hash, btcjson.Bool(true), btcjson.Bool(true))

func NewGetBlockCmd(hash string, verbose, verboseTx *bool) *GetBlockCmd {
	return &GetBlockCmd{
		Hash:      hash,
		Verbose:   verbose,
		VerboseTx: verboseTx,
	}
}

https://bitcoin.org/en/developer-reference#getblock

@asidorochev
Copy link

My fix for that issue: #1112

@wenweih wenweih changed the title [RPC] getblock command have been changed [RPC] getblock command has been changed Jan 26, 2018
@wenweih
Copy link
Author

wenweih commented Jan 26, 2018

@asidorochev cool

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants