Refactor `BestBlock` to expose inner fields rather than accessors
[rust-lightning] / lightning / src / chain / mod.rs
index 368dd8497b037e4821c0c41b0de7f3e7585d8042..5d367bd4afa49d8a1a73306534f2d7e1bb4bf6ab 100644 (file)
@@ -33,8 +33,10 @@ pub(crate) mod package;
 /// The best known block as identified by its hash and height.
 #[derive(Clone, Copy, 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 }
 }