projects
/
rust-lightning
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
OnionMessenger: support generating peer connection events.
[rust-lightning]
/
lightning
/
src
/
chain
/
mod.rs
diff --git
a/lightning/src/chain/mod.rs
b/lightning/src/chain/mod.rs
index 368dd8497b037e4821c0c41b0de7f3e7585d8042..e22ccca986aacf622778c7c4c3c5320b3815e341 100644
(file)
--- a/
lightning/src/chain/mod.rs
+++ b/
lightning/src/chain/mod.rs
@@
-21,6
+21,7
@@
use crate::ln::ChannelId;
use crate::sign::ecdsa::WriteableEcdsaChannelSigner;
use crate::chain::transaction::{OutPoint, TransactionData};
use crate::sign::ecdsa::WriteableEcdsaChannelSigner;
use crate::chain::transaction::{OutPoint, TransactionData};
+#[allow(unused_imports)]
use crate::prelude::*;
pub mod chaininterface;
use crate::prelude::*;
pub mod chaininterface;
@@
-31,10
+32,12
@@
pub(crate) mod onchaintx;
pub(crate) mod package;
/// The best known block as identified by its hash and height.
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 {
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 {
}
impl BestBlock {
@@
-51,12
+54,6
@@
impl BestBlock {
pub fn new(block_hash: BlockHash, height: u32) -> Self {
BestBlock { block_hash, height }
}
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 }
}
}