projects
/
rust-lightning
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #3029 from TheBlueMatt/2024-04-fix-batch-funding-failures
[rust-lightning]
/
lightning
/
src
/
chain
/
mod.rs
diff --git
a/lightning/src/chain/mod.rs
b/lightning/src/chain/mod.rs
index 368dd8497b037e4821c0c41b0de7f3e7585d8042..1fb30a9aeb5f9375b4e1ecdac2950aea62a9ab37 100644
(file)
--- a/
lightning/src/chain/mod.rs
+++ b/
lightning/src/chain/mod.rs
@@
-20,7
+20,9
@@
use crate::chain::channelmonitor::{ChannelMonitor, ChannelMonitorUpdate, Monitor
use crate::ln::ChannelId;
use crate::sign::ecdsa::WriteableEcdsaChannelSigner;
use crate::chain::transaction::{OutPoint, TransactionData};
use crate::ln::ChannelId;
use crate::sign::ecdsa::WriteableEcdsaChannelSigner;
use crate::chain::transaction::{OutPoint, TransactionData};
+use crate::impl_writeable_tlv_based;
+#[allow(unused_imports)]
use crate::prelude::*;
pub mod chaininterface;
use crate::prelude::*;
pub mod chaininterface;
@@
-31,10
+33,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,14
+55,13
@@
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 }
}
}
+impl_writeable_tlv_based!(BestBlock, {
+ (0, block_hash, required),
+ (2, height, required),
+});
+
/// The `Listen` trait is used to notify when blocks have been connected or disconnected from the
/// chain.
/// The `Listen` trait is used to notify when blocks have been connected or disconnected from the
/// chain.