Skip to content

Commit

Permalink
Use original funding TXO to get channel monitors
Browse files Browse the repository at this point in the history
  • Loading branch information
luckysori committed Dec 20, 2023
1 parent c8809b8 commit 20e2b3a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lightning/src/ln/channelmanager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2623,7 +2623,6 @@ where
return Err(APIError::ChannelUnavailable { err: "Channel is not useable.".to_string() });
}


let channel_value = chan.context().get_value_satoshis();
let own_balance = chan.context().get_available_balances(&self.fee_estimator).balance_msat;
let funding_outpoint = chan.context().channel_transaction_parameters.funding_outpoint.unwrap();
Expand All @@ -2640,7 +2639,6 @@ where
}
}


let mon_update_blocked = {
let actions_blocking_raa_monitor_updates = &peer_state.actions_blocking_raa_monitor_updates;
let original_funding_txo = channel.context.get_original_funding_txo().unwrap();
Expand Down Expand Up @@ -9838,7 +9836,7 @@ where
if let ChannelPhase::Funded(chan) = phase {
// Channels that were persisted have to be funded, otherwise they should have been
// discarded.
let funding_txo = chan.context.get_funding_txo().ok_or(DecodeError::InvalidValue)?;
let funding_txo = chan.context.get_original_funding_txo().ok_or(DecodeError::InvalidValue)?;
let monitor = args.channel_monitors.get(&funding_txo)
.expect("We already checked for monitor presence when loading channels");
let mut max_in_flight_update_id = monitor.get_latest_update_id();
Expand Down

0 comments on commit 20e2b3a

Please sign in to comment.