Add `genesis_hash` function to Blockchain

This commit is contained in:
Andrew Poelstra 2014-07-28 12:30:45 -07:00
parent 6f7e73d6b4
commit 1938959017
1 changed files with 5 additions and 0 deletions

View File

@ -560,6 +560,11 @@ impl Blockchain {
self.best_tip = tip; self.best_tip = tip;
} }
/// Returns the genesis block's blockhash
pub fn genesis_hash(&self) -> Sha256dHash {
self.genesis_hash
}
/// Returns the best tip /// Returns the best tip
pub fn best_tip<'a>(&'a self) -> &'a Block { pub fn best_tip<'a>(&'a self) -> &'a Block {
unsafe { &(*self.best_tip).block } unsafe { &(*self.best_tip).block }