X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fchain%2Fmod.rs;h=356520b5cba86e647acdec77fd0cb86b683e7d58;hb=edb22e1ab9818c4f9efe85c7752c6048589489c9;hp=368dd8497b037e4821c0c41b0de7f3e7585d8042;hpb=7c9463668a4f71663746e57bdb09ee6b91797d5a;p=rust-lightning diff --git a/lightning/src/chain/mod.rs b/lightning/src/chain/mod.rs index 368dd849..356520b5 100644 --- a/lightning/src/chain/mod.rs +++ b/lightning/src/chain/mod.rs @@ -31,10 +31,12 @@ pub(crate) mod onchaintx; pub(crate) mod package; /// The best known block as identified by its hash and height. -#[derive(Clone, Copy, PartialEq, Eq)] +#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq)] pub struct BestBlock { - block_hash: BlockHash, - height: u32, + /// The block's hash + pub block_hash: BlockHash, + /// The height at which the block was confirmed. + pub height: u32, } impl BestBlock { @@ -51,12 +53,6 @@ impl BestBlock { pub fn new(block_hash: BlockHash, height: u32) -> Self { BestBlock { block_hash, height } } - - /// Returns the best block hash. - pub fn block_hash(&self) -> BlockHash { self.block_hash } - - /// Returns the best block height. - pub fn height(&self) -> u32 { self.height } }