8000 [Trivial] add get_best_tip_height to blokchain by tamasblummer · Pull Request #50 · rust-bitcoin/rust-bitcoin · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[Trivial] add get_best_tip_height to blokchain #50

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

Merged
merged 4 commits into from
Mar 9, 2018

Conversation

tamasblummer
Copy link
Contributor

tip height is a useful information readily computed by the tree. It is e.g. needed to set the height in a version message that a peer would send. Added a public method to retrieve it.

@tamasblummer tamasblummer changed the title add get_best_tip_height to blokchain [Trivial] add get_best_tip_height to blokchain Feb 28, 2018
@tamasblummer
Copy link
Contributor Author

I figured tip height it is accessible through get_block(best_tip().bitcoin_hash()).unwrap().height but that's ugly

Copy link
Member
@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

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

I'm going to merge this, but my feeling is that the blockchain module should really be split out into its own crate, since the focus of rust-bitcoin is mainly de/serialization now.

@tamasblummer
Copy link
Contributor Author

I also support blockchain out into its own crate. May I go ahaead, as I already worked on otimizing its performance?

@apoelstra
Copy link
Member

@tamasblummer Yes, I'd love that

@apoelstra apoelstra merged commit 10d6aba into rust-bitcoin:master Mar 9, 2018
@TheBlueMatt
Copy link
Member
TheBlueMatt commented Mar 9, 2018 via email

@tamasblummer
Copy link
Contributor Author

Working on it. @apoelstra @TheBlueMatt : I think the script interpreter code should also be retired in favor of libbitcoinconsenus.

@TheBlueMatt
Copy link
Member
TheBlueMatt commented Mar 9, 2018 via email

@apoelstra
Copy link
Member

Agreed, I'd welcome a PR to remove the script_consensus stuff (or I will make one myself when I get a moment)

@tamasblummer tamasblummer deleted the get_tip_height branch March 12, 2018 20:20
yancyribbens pushed a commit to yancyribbens/rust-bitcoin that referenced this pull request Mar 23, 2024
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.

3 participants
0