File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -195,8 +195,7 @@ impl BitcoindChainSource {
195195 {
196196 Ok ( chain_tip) => {
197197 {
198- #[ allow( clippy:: unwrap_used) ]
199- let elapsed_ms = now. elapsed ( ) . unwrap ( ) . as_millis ( ) ;
198+ let elapsed_ms = now. elapsed ( ) . map ( |d| d. as_millis ( ) ) . unwrap_or ( 0 ) ;
200199 log_info ! (
201200 self . logger,
202201 "Finished synchronizing listeners in {}ms" ,
@@ -413,8 +412,7 @@ impl BitcoindChainSource {
413412 let now = SystemTime :: now ( ) ;
414413 match spv_client. poll_best_tip ( ) . await {
415414 Ok ( ( ChainTip :: Better ( tip) , true ) ) => {
416- #[ allow( clippy:: unwrap_used) ]
417- let elapsed_ms = now. elapsed ( ) . unwrap ( ) . as_millis ( ) ;
415+ let elapsed_ms = now. elapsed ( ) . map ( |d| d. as_millis ( ) ) . unwrap_or ( 0 ) ;
418416 log_trace ! ( self . logger, "Finished polling best tip in {}ms" , elapsed_ms) ;
419417 * self . latest_chain_tip . wlck ( ) = Some ( tip) ;
420418 } ,
@@ -435,8 +433,7 @@ impl BitcoindChainSource {
435433 . await
436434 {
437435 Ok ( ( unconfirmed_txs, evicted_txids) ) => {
438- #[ allow( clippy:: unwrap_used) ]
439- let elapsed_ms = now. elapsed ( ) . unwrap ( ) . as_millis ( ) ;
436+ let elapsed_ms = now. elapsed ( ) . map ( |d| d. as_millis ( ) ) . unwrap_or ( 0 ) ;
440437 log_trace ! (
441438 self . logger,
442439 "Finished polling mempool of size {} and {} evicted transactions in {}ms" ,
You can’t perform that action at this time.
0 commit comments