Skip to content

Commit 0fbbac4

Browse files
committed
Cleanup poll_and_update_listeners_inner logic
.. now that we don't manually need to propagate anymore.
1 parent 33f8165 commit 0fbbac4

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
@@ -329,9 +329,7 @@ impl BitcoindChainSource {
329329
},
330330
Err(e) => {
331331
log_error!(self.logger, "Failed to poll for chain data: {:?}", e);
332-
let res = Err(Error::TxSyncFailed);
333-
self.wallet_polling_status.lock().unwrap().propagate_result_to_subscribers(res);
334-
return res;
332+
return Err(Error::TxSyncFailed);
335333
},
336334
}
337335
};
@@ -360,9 +358,7 @@ impl BitcoindChainSource {
360358
Ok(_) => {},
361359
Err(e) => {
362360
log_error!(self.logger, "Failed to poll for chain data: {:?}", e);
363-
let res = Err(Error::TxSyncFailed);
364-
self.wallet_polling_status.lock().unwrap().propagate_result_to_subscribers(res);
365-
return res;
361+
return Err(Error::TxSyncFailed);
366362
},
367363
}
368364

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

@@ -400,20 +394,11 @@ impl BitcoindChainSource {
400394
locked_node_metrics.latest_lightning_wallet_sync_timestamp = unix_time_secs_opt;
401395
locked_node_metrics.latest_onchain_wallet_sync_timestamp = unix_time_secs_opt;
402396

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

418403
Ok(())
419404
}

0 commit comments

Comments
 (0)