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 result is missing chainwork #413

Closed
arnuschky opened this issue May 4, 2015 · 3 comments
Closed

[rpc] getblock result is missing chainwork #413

arnuschky opened this issue May 4, 2015 · 3 comments

Comments

@arnuschky
Copy link

Thegetblock RPC call is missing the chainwork attribute in its result.
I just noticed this when comparing the results from btcd and bitcoin core in-system.

Not that I need it, but , so I figured I post a note in any case. :)

@davecgh
Copy link
Member

davecgh commented May 4, 2015

Thanks for reporting.

That was a more recent addition to BC and not something we currently store or have access to because our chain index is dynamically created at start-up and pruned during operation. This helps reduce memory usage as, in practice, you never really need the chain index nodes prior to the last retarget interval (however they are dynamically loaded and the chain work adjusted accordingly if needed, but in practice, nothing on the main network is going to fork that far back anyways...). As a result, our chainwork starts from 0 for whatever the oldest generated chain index is on each start-up. The reason this isn't an issue is because the important part for keeping track of the work is the relative figures across multiple chain branches (forks). So long as the parent of those chains start at the same value, its actual value is irrelevant.

That said, we'll probably end up keeping a running work total in the metadata as a part of the upcoming chain updates to accommodate the changes required by the database2 pull request (#380) at which point we could potentially expose the field. However, I don't imagine anyone is actually using it for anything more than a fun fact.

@arnuschky
Copy link
Author

However, I don't imagine anyone is actually using it for anything more than a fun fact.

Yes - I certainly never did. Just thought reporting it might save someone depending on it some time...

@davecgh davecgh changed the title getblock result is missing chainwork [rpc] getblock result is missing chainwork May 4, 2015
@davecgh davecgh added the rpc label May 27, 2015
@jakesylvestre
Copy link
Collaborator

Looks like this was fixed in #1484

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

No branches or pull requests

3 participants