@@ -23,43 +23,43 @@ where
2323
2424/// Callback for when a new PoW valid block is found.
2525pub trait NewPoWValidBlockCallback : Send + Sync {
26- fn on_new_pow_valid_block < ' a > ( & self , block : Block , pindex : BlockTreeEntry < ' a > ) ;
26+ fn on_new_pow_valid_block < ' a > ( & self , block : Block , entry : BlockTreeEntry < ' a > ) ;
2727}
2828
2929impl < F > NewPoWValidBlockCallback for F
3030where
3131 F : for < ' a > Fn ( BlockTreeEntry < ' a > , Block ) + Send + Sync + ' static ,
3232{
33- fn on_new_pow_valid_block < ' a > ( & self , block : Block , pindex : BlockTreeEntry < ' a > ) {
34- self ( pindex , block)
33+ fn on_new_pow_valid_block < ' a > ( & self , block : Block , entry : BlockTreeEntry < ' a > ) {
34+ self ( entry , block)
3535 }
3636}
3737
3838/// Callback for when a block is connected to the chain.
3939pub trait BlockConnectedCallback : Send + Sync {
40- fn on_block_connected < ' a > ( & self , block : Block , pindex : BlockTreeEntry < ' a > ) ;
40+ fn on_block_connected < ' a > ( & self , block : Block , entry : BlockTreeEntry < ' a > ) ;
4141}
4242
4343impl < F > BlockConnectedCallback for F
4444where
4545 F : for < ' a > Fn ( Block , BlockTreeEntry < ' a > ) + Send + Sync + ' static ,
4646{
47- fn on_block_connected < ' a > ( & self , block : Block , pindex : BlockTreeEntry < ' a > ) {
48- self ( block, pindex )
47+ fn on_block_connected < ' a > ( & self , block : Block , entry : BlockTreeEntry < ' a > ) {
48+ self ( block, entry )
4949 }
5050}
5151
5252/// Callback for when a block is disconnected from the chain.
5353pub trait BlockDisconnectedCallback : Send + Sync {
54- fn on_block_disconnected < ' a > ( & self , block : Block , pindex : BlockTreeEntry < ' a > ) ;
54+ fn on_block_disconnected < ' a > ( & self , block : Block , entry : BlockTreeEntry < ' a > ) ;
5555}
5656
5757impl < F > BlockDisconnectedCallback for F
5858where
5959 F : for < ' a > Fn ( Block , BlockTreeEntry < ' a > ) + Send + Sync + ' static ,
6060{
61- fn on_block_disconnected < ' a > ( & self , block : Block , pindex : BlockTreeEntry < ' a > ) {
62- self ( block, pindex )
61+ fn on_block_disconnected < ' a > ( & self , block : Block , entry : BlockTreeEntry < ' a > ) {
62+ self ( block, entry )
6363 }
6464}
6565
@@ -134,47 +134,47 @@ pub(crate) unsafe extern "C" fn validation_block_checked_wrapper(
134134pub ( crate ) unsafe extern "C" fn validation_new_pow_valid_block_wrapper (
135135 user_data : * mut c_void ,
136136 block : * mut btck_Block ,
137- pindex : * const btck_BlockTreeEntry ,
137+ entry : * const btck_BlockTreeEntry ,
138138) {
139139 let block = Block :: from_ptr ( block) ;
140140 let registry = & * ( user_data as * mut ValidationCallbackRegistry ) ;
141141
142142 if let Some ( ref handler) = registry. new_pow_valid_block_handler {
143143 handler. on_new_pow_valid_block (
144144 block,
145- BlockTreeEntry :: from_ptr ( pindex as * mut btck_BlockTreeEntry ) ,
145+ BlockTreeEntry :: from_ptr ( entry as * mut btck_BlockTreeEntry ) ,
146146 ) ;
147147 }
148148}
149149
150150pub ( crate ) unsafe extern "C" fn validation_block_connected_wrapper (
151151 user_data : * mut c_void ,
152152 block : * mut btck_Block ,
153- pindex : * const btck_BlockTreeEntry ,
153+ entry : * const btck_BlockTreeEntry ,
154154) {
155155 let block = Block :: from_ptr ( block) ;
156156 let registry = & * ( user_data as * mut ValidationCallbackRegistry ) ;
157157
158158 if let Some ( ref handler) = registry. block_connected_handler {
159159 handler. on_block_connected (
160160 block,
161- BlockTreeEntry :: from_ptr ( pindex as * mut btck_BlockTreeEntry ) ,
161+ BlockTreeEntry :: from_ptr ( entry as * mut btck_BlockTreeEntry ) ,
162162 ) ;
163163 }
164164}
165165
166166pub ( crate ) unsafe extern "C" fn validation_block_disconnected_wrapper (
167167 user_data : * mut c_void ,
168168 block : * mut btck_Block ,
169- pindex : * const btck_BlockTreeEntry ,
169+ entry : * const btck_BlockTreeEntry ,
170170) {
171171 let block = Block :: from_ptr ( block) ;
172172 let registry = & * ( user_data as * mut ValidationCallbackRegistry ) ;
173173
174174 if let Some ( ref handler) = registry. block_disconnected_handler {
175175 handler. on_block_disconnected (
176176 block,
177- BlockTreeEntry :: from_ptr ( pindex as * mut btck_BlockTreeEntry ) ,
177+ BlockTreeEntry :: from_ptr ( entry as * mut btck_BlockTreeEntry ) ,
178178 ) ;
179179 }
180180}
@@ -213,7 +213,7 @@ mod tests {
213213
214214 #[ test]
215215 fn test_new_pow_valid_block_registration ( ) {
216- fn handler ( _pindex : BlockTreeEntry , _block : Block ) { }
216+ fn handler ( _entry : BlockTreeEntry , _block : Block ) { }
217217
218218 let mut registry = ValidationCallbackRegistry :: new ( ) ;
219219 registry. register_new_pow_valid_block ( handler) ;
@@ -222,7 +222,7 @@ mod tests {
222222
223223 #[ test]
224224 fn test_block_connected_registration ( ) {
225- fn handler ( _block : Block , _pindex : BlockTreeEntry ) { }
225+ fn handler ( _block : Block , _entry : BlockTreeEntry ) { }
226226
227227 let mut registry = ValidationCallbackRegistry :: new ( ) ;
228228 registry. register_block_connected ( handler) ;
@@ -231,7 +231,7 @@ mod tests {
231231
232232 #[ test]
233233 fn test_block_disconnected_registration ( ) {
234- fn handler ( _block : Block , _pindex : BlockTreeEntry ) { }
234+ fn handler ( _block : Block , _entry : BlockTreeEntry ) { }
235235
236236 let mut registry = ValidationCallbackRegistry :: new ( ) ;
237237 registry. register_block_disconnected ( handler) ;
@@ -272,14 +272,14 @@ mod tests {
272272 let called_clone = Arc :: clone ( & called) ;
273273
274274 let mut registry = ValidationCallbackRegistry :: new ( ) ;
275- registry. register_new_pow_valid_block ( move |_pindex : BlockTreeEntry , _block : Block | {
275+ registry. register_new_pow_valid_block ( move |_entry : BlockTreeEntry , _block : Block | {
276276 * called_clone. lock ( ) . unwrap ( ) = true ;
277277 } ) ;
278278
279279 if let Some ( ref handler) = registry. new_pow_valid_block_handler {
280280 let block = unsafe { Block :: from_ptr ( std:: ptr:: null_mut ( ) ) } ;
281- let pindex = unsafe { BlockTreeEntry :: from_ptr ( std:: ptr:: null_mut ( ) ) } ;
282- handler. on_new_pow_valid_block ( block, pindex ) ;
281+ let entry = unsafe { BlockTreeEntry :: from_ptr ( std:: ptr:: null_mut ( ) ) } ;
282+ handler. on_new_pow_valid_block ( block, entry ) ;
283283 }
284284
285285 assert ! ( * called. lock( ) . unwrap( ) ) ;
@@ -291,14 +291,14 @@ mod tests {
291291 let called_clone = Arc :: clone ( & called) ;
292292
293293 let mut registry = ValidationCallbackRegistry :: new ( ) ;
294- registry. register_block_connected ( move |_block : Block , _pindex : BlockTreeEntry | {
294+ registry. register_block_connected ( move |_block : Block , _entry : BlockTreeEntry | {
295295 * called_clone. lock ( ) . unwrap ( ) = true ;
296296 } ) ;
297297
298298 if let Some ( ref handler) = registry. block_connected_handler {
299299 let block = unsafe { Block :: from_ptr ( std:: ptr:: null_mut ( ) ) } ;
300- let pindex = unsafe { BlockTreeEntry :: from_ptr ( std:: ptr:: null_mut ( ) ) } ;
301- handler. on_block_connected ( block, pindex ) ;
300+ let entry = unsafe { BlockTreeEntry :: from_ptr ( std:: ptr:: null_mut ( ) ) } ;
301+ handler. on_block_connected ( block, entry ) ;
302302 }
303303
304304 assert ! ( * called. lock( ) . unwrap( ) ) ;
@@ -310,14 +310,14 @@ mod tests {
310310 let called_clone = Arc :: clone ( & called) ;
311311
312312 let mut registry = ValidationCallbackRegistry :: new ( ) ;
313- registry. register_block_disconnected ( move |_block : Block , _pindex : BlockTreeEntry | {
313+ registry. register_block_disconnected ( move |_block : Block , _entry : BlockTreeEntry | {
314314 * called_clone. lock ( ) . unwrap ( ) = true ;
315315 } ) ;
316316
317317 if let Some ( ref handler) = registry. block_disconnected_handler {
318318 let block = unsafe { Block :: from_ptr ( std:: ptr:: null_mut ( ) ) } ;
319- let pindex = unsafe { BlockTreeEntry :: from_ptr ( std:: ptr:: null_mut ( ) ) } ;
320- handler. on_block_disconnected ( block, pindex ) ;
319+ let entry = unsafe { BlockTreeEntry :: from_ptr ( std:: ptr:: null_mut ( ) ) } ;
320+ handler. on_block_disconnected ( block, entry ) ;
321321 }
322322
323323 assert ! ( * called. lock( ) . unwrap( ) ) ;
0 commit comments