We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
try_into
1 parent 95d4db0 commit e809b92Copy full SHA for e809b92
lightning/src/ln/channel.rs
@@ -46,7 +46,6 @@ use crate::io;
46
use crate::prelude::*;
47
use core::{cmp,mem,fmt};
48
use core::ops::Deref;
49
-use core::convert::TryInto;
50
#[cfg(any(test, fuzzing, debug_assertions))]
51
use crate::sync::Mutex;
52
use bitcoin::hashes::hex::ToHex;
@@ -4532,8 +4531,8 @@ impl<Signer: Sign> Channel<Signer> {
4532
4531
// We either haven't seen any confirmation yet, or observed a reorg.
4533
return 0;
4534
}
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)
+
+ height.checked_sub(self.funding_tx_confirmation_height).map_or(0, |c| c + 1)
4537
4538
4539
fn get_holder_selected_contest_delay(&self) -> u16 {
0 commit comments