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

Implement stake voter version interrogation command. #522

Merged
merged 1 commit into from
Dec 22, 2016

Conversation

marcopeereboom
Copy link
Member

@marcopeereboom marcopeereboom commented Dec 22, 2016

Implement dcrctl getstakeversions command. This PR also expands the findNode command to search arbitrary depths but maintains backwards compat by implementing the prior 2800 depth max constant.

Example: dcrctl getstakeversions $(dcrctl getbestblockhash) 10
returns the last 10 stake/voter versions stats.

Fixes #521

Copy link
Member

@alexlyp alexlyp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dcrctl getstakeversions numblocks returned valid responses, but unclear what those responses mean

//
// This function MUST be called with the chain state lock held (for writes).
func (b *BlockChain) findNode(nodeHash *chainhash.Hash) (*blockNode, error) {
func (b *BlockChain) findNode(nodeHash *chainhash.Hash, searchDepth int) (*blockNode, error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are you adding searchDepth arg here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because one may be looking for the stats of block 12 while the chain is at 90000.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, with added explanation in PR

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

Successfully merging this pull request may close these issues.

2 participants