From 50a9d0f51ff59762298fa6b0b8b1d9511da2bd91 Mon Sep 17 00:00:00 2001 From: Tamas Blummer Date: Wed, 28 Feb 2018 20:04:38 +0100 Subject: [PATCH] add get_best_tip_height to blokchain --- src/blockdata/blockchain.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/blockdata/blockchain.rs b/src/blockdata/blockchain.rs index 385da017..2cf6e22c 100644 --- a/src/blockdata/blockchain.rs +++ b/src/blockdata/blockchain.rs @@ -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