From 20e2b3a9160a063f83ab7e58358c58ee2965dbbc Mon Sep 17 00:00:00 2001 From: Lucas Soriano del Pino Date: Thu, 2 Nov 2023 00:56:25 +1100 Subject: [PATCH] Use original funding TXO to get channel monitors --- lightning/src/ln/channelmanager.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lightning/src/ln/channelmanager.rs b/lightning/src/ln/channelmanager.rs index 4c92993c2f8..f65976c7622 100644 --- a/lightning/src/ln/channelmanager.rs +++ b/lightning/src/ln/channelmanager.rs @@ -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(); @@ -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(); @@ -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();