Skip to content

Commit e809b92

Browse files
committed
f Don't try_into
1 parent 95d4db0 commit e809b92

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lightning/src/ln/channel.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ use crate::io;
4646
use crate::prelude::*;
4747
use core::{cmp,mem,fmt};
4848
use core::ops::Deref;
49-
use core::convert::TryInto;
5049
#[cfg(any(test, fuzzing, debug_assertions))]
5150
use crate::sync::Mutex;
5251
use bitcoin::hashes::hex::ToHex;
@@ -4532,8 +4531,8 @@ impl<Signer: Sign> Channel<Signer> {
45324531
// We either haven't seen any confirmation yet, or observed a reorg.
45334532
return 0;
45344533
}
4535-
let funding_tx_confirmations = height as i64 - self.funding_tx_confirmation_height as i64 + 1;
4536-
funding_tx_confirmations.try_into().unwrap_or(0)
4534+
4535+
height.checked_sub(self.funding_tx_confirmation_height).map_or(0, |c| c + 1)
45374536
}
45384537

45394538
fn get_holder_selected_contest_delay(&self) -> u16 {

0 commit comments

Comments
 (0)