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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/blockdata/blockchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,11 @@ impl Blockchain {
unsafe { &(*self.best_tip).block }
}

/// Returns the best tip height
pub fn best_tip_height(&self) -> u32 {
unsafe { (*self.best_tip).height }
}

/// Returns the best tip's blockhash
pub fn best_tip_hash(&self) -> Sha256dHash {
self.best_hash
Expand Down
0