Skip to content

Commit 61aba25

Browse files
committed
Drop OutputSweeper non-BestBlock Readable implementation
`OutputSweeper`, like any `Confirm`/`Listen` client, needs to have the chain synced back up on startup. Thus, like `ChannelMonitor` and `ChannelManager`, we force users to `read` it via a method that gives them the latest chain tip so that they can sync.
1 parent 2917fd2 commit 61aba25

File tree

1 file changed

+0
-49
lines changed

1 file changed

+0
-49
lines changed

lightning/src/util/sweep.rs

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -827,55 +827,6 @@ pub enum SpendingDelay {
827827
},
828828
}
829829

830-
impl<B: Deref, D: Deref, E: Deref, F: Deref, K: Deref, L: Deref, O: Deref>
831-
ReadableArgs<(B, E, Option<F>, O, D, K, L)> for OutputSweeper<B, D, E, F, K, L, O>
832-
where
833-
B::Target: BroadcasterInterface,
834-
D::Target: ChangeDestinationSource,
835-
E::Target: FeeEstimator,
836-
F::Target: Filter + Sync + Send,
837-
K::Target: KVStore,
838-
L::Target: Logger,
839-
O::Target: OutputSpender,
840-
{
841-
#[inline]
842-
fn read<R: io::Read>(
843-
reader: &mut R, args: (B, E, Option<F>, O, D, K, L),
844-
) -> Result<Self, DecodeError> {
845-
let (
846-
broadcaster,
847-
fee_estimator,
848-
chain_data_source,
849-
output_spender,
850-
change_destination_source,
851-
kv_store,
852-
logger,
853-
) = args;
854-
let state = SweeperState::read(reader)?;
855-
let best_block = state.best_block;
856-
857-
if let Some(filter) = chain_data_source.as_ref() {
858-
for output_info in &state.outputs {
859-
let watched_output = output_info.to_watched_output(best_block.block_hash);
860-
filter.register_output(watched_output);
861-
}
862-
}
863-
864-
let sweeper_state = Mutex::new(state);
865-
Ok(Self {
866-
sweeper_state,
867-
pending_sweep: AtomicBool::new(false),
868-
broadcaster,
869-
fee_estimator,
870-
chain_data_source,
871-
output_spender,
872-
change_destination_source,
873-
kv_store,
874-
logger,
875-
})
876-
}
877-
}
878-
879830
impl<B: Deref, D: Deref, E: Deref, F: Deref, K: Deref, L: Deref, O: Deref>
880831
ReadableArgs<(B, E, Option<F>, O, D, K, L)> for (BestBlock, OutputSweeper<B, D, E, F, K, L, O>)
881832
where

0 commit comments

Comments
 (0)