X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fchain%2Fmod.rs;h=1fb30a9aeb5f9375b4e1ecdac2950aea62a9ab37;hb=eebab4015d9c84b1b605c498c9b6c166369cdb8b;hp=5d367bd4afa49d8a1a73306534f2d7e1bb4bf6ab;hpb=57911dcd415d2f9cafdbcef1ab9b0d38de3954fa;p=rust-lightning diff --git a/lightning/src/chain/mod.rs b/lightning/src/chain/mod.rs index 5d367bd4..1fb30a9a 100644 --- 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::impl_writeable_tlv_based; +#[allow(unused_imports)] use crate::prelude::*; pub mod chaininterface; @@ -31,7 +33,7 @@ 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 { /// The block's hash pub block_hash: BlockHash, @@ -55,6 +57,11 @@ impl BestBlock { } } +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.