Skip to content

Commit b26ca18

Browse files
committed
Cleanup poll_and_update_listeners_inner logic
.. now that we don't manually need to propagate anymore.
1 parent a1d1fc9 commit b26ca18

File tree

1 file changed

+5
-20
lines changed

1 file changed

+5
-20
lines changed

src/chain/bitcoind.rs

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -330,9 +330,7 @@ impl BitcoindChainSource {
330330
},
331331
Err(e) => {
332332
log_error!(self.logger, "Failed to poll for chain data: {:?}", e);
333-
let res = Err(Error::TxSyncFailed);
334-
self.wallet_polling_status.lock().unwrap().propagate_result_to_subscribers(res);
335-
return res;
333+
return Err(Error::TxSyncFailed);
336334
},
337335
}
338336
};
@@ -361,9 +359,7 @@ impl BitcoindChainSource {
361359
Ok(_) => {},
362360
Err(e) => {
363361
log_error!(self.logger, "Failed to poll for chain data: {:?}", e);
364-
let res = Err(Error::TxSyncFailed);
365-
self.wallet_polling_status.lock().unwrap().propagate_result_to_subscribers(res);
366-
return res;
362+
return Err(Error::TxSyncFailed);
367363
},
368364
}
369365

@@ -389,9 +385,7 @@ impl BitcoindChainSource {
389385
},
390386
Err(e) => {
391387
log_error!(self.logger, "Failed to poll for mempool transactions: {:?}", e);
392-
let res = Err(Error::TxSyncFailed);
393-
self.wallet_polling_status.lock().unwrap().propagate_result_to_subscribers(res);
394-
return res;
388+
return Err(Error::TxSyncFailed);
395389
},
396390
}
397391

@@ -401,20 +395,11 @@ impl BitcoindChainSource {
401395
locked_node_metrics.latest_lightning_wallet_sync_timestamp = unix_time_secs_opt;
402396
locked_node_metrics.latest_onchain_wallet_sync_timestamp = unix_time_secs_opt;
403397

404-
let write_res = write_node_metrics(
398+
write_node_metrics(
405399
&*locked_node_metrics,
406400
Arc::clone(&self.kv_store),
407401
Arc::clone(&self.logger),
408-
);
409-
match write_res {
410-
Ok(()) => (),
411-
Err(e) => {
412-
log_error!(self.logger, "Failed to persist node metrics: {}", e);
413-
let res = Err(Error::PersistenceFailed);
414-
self.wallet_polling_status.lock().unwrap().propagate_result_to_subscribers(res);
415-
return res;
416-
},
417-
}
402+
)?;
418403

419404
Ok(())
420405
}

0 commit comments

Comments
 (0)