Struct lightning_signer::chain::tracker::ChainTracker [−][src]
pub struct ChainTracker<L: ChainListener + Ord> {
pub headers: VecDeque<BlockHeader>,
pub tip: BlockHeader,
pub height: u32,
pub network: Network,
pub listeners: Map<L, ListenSlot>,
}
Expand description
Track chain, with basic validation
Fields
headers: VecDeque<BlockHeader>
headers past the tip
tip: BlockHeader
tip header
height: u32
height
network: Network
The network
listeners: Map<L, ListenSlot>
listeners
Implementations
Create a new tracker
Current chain tip header
Headers past the tip
pub fn remove_block(
&mut self,
txs: Vec<Transaction>,
txs_proof: Option<PartialMerkleTree>
) -> Result<BlockHeader, Error>
pub fn remove_block(
&mut self,
txs: Vec<Transaction>,
txs_proof: Option<PartialMerkleTree>
) -> Result<BlockHeader, Error>
Remove block at tip due to reorg
pub fn add_block(
&mut self,
header: BlockHeader,
txs: Vec<Transaction>,
txs_proof: Option<PartialMerkleTree>
) -> Result<(), Error>
pub fn add_block(
&mut self,
header: BlockHeader,
txs: Vec<Transaction>,
txs_proof: Option<PartialMerkleTree>
) -> Result<(), Error>
Add a block, which becomes the new tip
Add a listener and initialize the watched outpoint set
Add more watches to a listener