@@ -320,22 +320,14 @@ impl<I> SyncRequest<I> {
320
320
self . chain_tip . clone ( )
321
321
}
322
322
323
- /// Advances the sync request and returns the next [`ScriptBuf`].
324
- ///
325
- /// Returns [`None`] when there are no more scripts remaining in the request.
326
- pub fn next_spk ( & mut self ) -> Option < ScriptBuf > {
327
- let ( i, spk) = self . spks . pop_front ( ) ?;
328
- self . spks_consumed += 1 ;
329
- self . _call_inspect ( SyncItem :: Spk ( i, spk. as_script ( ) ) ) ;
330
- Some ( spk)
331
- }
332
-
333
323
/// Advances the sync request and returns the next [`ScriptBuf`] with corresponding [`Txid`]
334
324
/// history.
335
325
///
336
326
/// Returns [`None`] when there are no more scripts remaining in the request.
337
327
pub fn next_spk_with_expected_txids ( & mut self ) -> Option < SpkWithExpectedTxids > {
338
- let next_spk = self . next_spk ( ) ?;
328
+ let ( i, next_spk) = self . spks . pop_front ( ) ?;
329
+ self . spks_consumed += 1 ;
330
+ self . _call_inspect ( SyncItem :: Spk ( i, next_spk. as_script ( ) ) ) ;
339
331
let spk_history = self
340
332
. spk_expected_txids
341
333
. get ( & next_spk)
@@ -367,11 +359,6 @@ impl<I> SyncRequest<I> {
367
359
Some ( outpoint)
368
360
}
369
361
370
- /// Iterate over [`ScriptBuf`]s contained in this request.
371
- pub fn iter_spks ( & mut self ) -> impl ExactSizeIterator < Item = ScriptBuf > + ' _ {
372
- SyncIter :: < I , ScriptBuf > :: new ( self )
373
- }
374
-
375
362
/// Iterate over [`ScriptBuf`]s with corresponding [`Txid`] histories contained in this request.
376
363
pub fn iter_spks_with_expected_txids (
377
364
& mut self ,
@@ -605,19 +592,6 @@ impl<'r, I, Item> SyncIter<'r, I, Item> {
605
592
606
593
impl < ' r , I , Item > ExactSizeIterator for SyncIter < ' r , I , Item > where SyncIter < ' r , I , Item > : Iterator { }
607
594
608
- impl < I > Iterator for SyncIter < ' _ , I , ScriptBuf > {
609
- type Item = ScriptBuf ;
610
-
611
- fn next ( & mut self ) -> Option < Self :: Item > {
612
- self . request . next_spk ( )
613
- }
614
-
615
- fn size_hint ( & self ) -> ( usize , Option < usize > ) {
616
- let remaining = self . request . spks . len ( ) ;
617
- ( remaining, Some ( remaining) )
618
- }
619
- }
620
-
621
595
impl < I > Iterator for SyncIter < ' _ , I , SpkWithExpectedTxids > {
622
596
type Item = SpkWithExpectedTxids ;
623
597
0 commit comments