Skip to content

Commit

Permalink
f Don't try_into
Browse files Browse the repository at this point in the history
  • Loading branch information
tnull committed Nov 21, 2022
1 parent 95d4db0 commit e809b92
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lightning/src/ln/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ use crate::io;
use crate::prelude::*;
use core::{cmp,mem,fmt};
use core::ops::Deref;
use core::convert::TryInto;
#[cfg(any(test, fuzzing, debug_assertions))]
use crate::sync::Mutex;
use bitcoin::hashes::hex::ToHex;
Expand Down Expand Up @@ -4532,8 +4531,8 @@ impl<Signer: Sign> Channel<Signer> {
// We either haven't seen any confirmation yet, or observed a reorg.
return 0;
}
let funding_tx_confirmations = height as i64 - self.funding_tx_confirmation_height as i64 + 1;
funding_tx_confirmations.try_into().unwrap_or(0)

height.checked_sub(self.funding_tx_confirmation_height).map_or(0, |c| c + 1)
}

fn get_holder_selected_contest_delay(&self) -> u16 {
Expand Down

0 comments on commit e809b92

Please sign in to comment.