-/// A trait indicating a desire to listen for events from the chain
-pub trait ChainListener: Sync + Send {
- /// Notifies a listener that a block was connected. Transactions may be filtered and are given
- /// paired with their position within the block.
- fn block_connected(&self, header: &BlockHeader, txdata: &[(usize, &Transaction)], height: u32);
-
- /// Notifies a listener that a block was disconnected.
- /// Unlike block_connected, this *must* never be called twice for the same disconnect event.
- /// Height must be the one of the block which was disconnected (not new height of the best chain)
- fn block_disconnected(&self, header: &BlockHeader, disconnected_height: u32);
-}
-