Merge pull request #50 from tamasblummer/get_tip_height

[Trivial] add get_best_tip_height to blokchain
This commit is contained in:
Andrew Poelstra 2018-03-09 15:09:14 +00:00 committed by GitHub
commit 10d6aba269
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -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