File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,24 @@ impl_writeable_tlv_based!(BestBlock, {
73
73
/// By using [`Listen::filtered_block_connected`] this interface supports clients fetching the
74
74
/// entire header chain and only blocks with matching transaction data using BIP 157 filters or
75
75
/// other similar filtering.
76
+ ///
77
+ /// # Requirements
78
+ ///
79
+ /// Each block must be connected in chain order with one call to either
80
+ /// [`Listen::block_connected`] or [`Listen::filtered_block_connected`]. If a call to the
81
+ /// [`Filter`] interface was made during block processing and further transaction(s) from the same
82
+ /// block now match the filter, a second call to [`Listen::filtered_block_connected`] should be
83
+ /// made immediately for the same block (prior to any other calls to the [`Listen`] interface).
84
+ ///
85
+ /// In case of a reorg, you must call [`Listen::blocks_disconnected`] once with information on the
86
+ /// "fork point" block, i.e. the highest block that is in both forks. You may call
87
+ /// [`Listen::blocks_disconnected`] multiple times as you walk the chain backwards, but each must
88
+ /// include a fork point block that is before the last.
89
+ ///
90
+ /// # Object Birthday
91
+ ///
92
+ /// Note that most implementations take a [`BestBlock`] on construction and blocks only need to be
93
+ /// applied starting from that point.
76
94
pub trait Listen {
77
95
/// Notifies the listener that a block was added at the given height, with the transaction data
78
96
/// possibly filtered.
You can’t perform that action at this time.
0 commit comments