Skip to content

Commit 7546fd6

Browse files
committed
Remove Sized requirement from ChainListener params
1 parent 24976bc commit 7546fd6

File tree

1 file changed

+4
-4
lines changed
  • lightning-block-sync/src

1 file changed

+4
-4
lines changed

lightning-block-sync/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ impl ChainNotifier {
248248
/// disconnected to the fork point. Thus, this may return an Err() that includes where the tip
249249
/// ended up which may not be new_header. Note that iff the returned Err has a BlockHeaderData,
250250
/// the header transition from old_header to new_header is valid.
251-
async fn sync_listener<CL: ChainListener + Sized, P: Poll>(&mut self, new_header: ValidatedBlockHeader, old_header: &ValidatedBlockHeader, chain_poller: &mut P, chain_listener: &mut CL) ->
251+
async fn sync_listener<CL: ChainListener, P: Poll>(&mut self, new_header: ValidatedBlockHeader, old_header: &ValidatedBlockHeader, chain_poller: &mut P, chain_listener: &mut CL) ->
252252
Result<(), (BlockSourceError, Option<ValidatedBlockHeader>)>
253253
{
254254
let mut events = self.find_fork(new_header, old_header, chain_poller).await.map_err(|e| (e, None))?;
@@ -392,7 +392,7 @@ impl<CS, B, F, L> ChainListener for (&mut ChannelMonitor<CS>, &B, &F, &L)
392392
/// to bring each ChannelMonitor, as well as the overall ChannelManager, into sync with each other.
393393
///
394394
/// Once you have them all at the same block, you should switch to using MicroSPVClient.
395-
pub async fn init_sync_listener<CL: ChainListener + Sized, B: BlockSource>(new_block: BlockHash, old_block: BlockHash, block_source: &mut B, network: Network, chain_listener: &mut CL) {
395+
pub async fn init_sync_listener<CL: ChainListener, B: BlockSource>(new_block: BlockHash, old_block: BlockHash, block_source: &mut B, network: Network, chain_listener: &mut CL) {
396396
if &old_block[..] == &[0; 32] { return; }
397397
if old_block == new_block { return; }
398398

@@ -455,7 +455,7 @@ impl<P: Poll> MicroSPVClient<P> {
455455

456456
/// Check each source for a new best tip and update the chain listener accordingly.
457457
/// Returns true if some blocks were [dis]connected, false otherwise.
458-
pub async fn poll_best_tip<CL: ChainListener + Sized>(&mut self, chain_listener: &mut CL) ->
458+
pub async fn poll_best_tip<CL: ChainListener>(&mut self, chain_listener: &mut CL) ->
459459
BlockSourceResult<(ChainTip, bool)>
460460
{
461461
let chain_tip = self.chain_poller.poll_chain_tip(self.chain_tip).await?;
@@ -477,7 +477,7 @@ impl<P: Poll> MicroSPVClient<P> {
477477

478478
/// Updates the chain tip, syncing the chain listener with any connected or disconnected
479479
/// blocks. Returns whether there were any such blocks.
480-
async fn update_chain_tip<CL: ChainListener + Sized>(&mut self, best_chain_tip: ValidatedBlockHeader, chain_listener: &mut CL) -> bool {
480+
async fn update_chain_tip<CL: ChainListener>(&mut self, best_chain_tip: ValidatedBlockHeader, chain_listener: &mut CL) -> bool {
481481
match self.chain_notifier.sync_listener(best_chain_tip, &self.chain_tip, &mut self.chain_poller, chain_listener).await {
482482
Ok(_) => {
483483
self.chain_tip = best_chain_tip;

0 commit comments

Comments
 (0)