@@ -1856,7 +1856,7 @@ impl Channel {
1856
1856
/// waiting on this revoke_and_ack. The generation of this new commitment_signed may also fail,
1857
1857
/// generating an appropriate error *after* the channel state has been updated based on the
1858
1858
/// revoke_and_ack message.
1859
- pub fn revoke_and_ack ( & mut self , msg : & msgs:: RevokeAndACK , fee_estimator : & FeeEstimator ) -> Result < ( Option < msgs:: CommitmentUpdate > , Vec < ( PendingForwardHTLCInfo , u64 ) > , Vec < ( HTLCSource , [ u8 ; 32 ] , HTLCFailReason ) > , Option < msgs:: ClosingSigned > , ChannelMonitor ) , HandleError > {
1859
+ pub fn revoke_and_ack ( & mut self , msg : & msgs:: RevokeAndACK , fee_estimator : & FeeEstimator ) -> Result < ( Option < msgs:: CommitmentUpdate > , Vec < ( PendingForwardHTLCInfo , u64 ) > , Vec < ( HTLCSource , [ u8 ; 32 ] , HTLCFailReason ) > , Option < msgs:: ClosingSigned > , ChannelMonitor , OutPoint ) , HandleError > {
1860
1860
if ( self . channel_state & ( ChannelState :: ChannelFunded as u32 ) ) != ( ChannelState :: ChannelFunded as u32 ) {
1861
1861
return Err ( HandleError { err : "Got revoke/ACK message when channel was not in an operational state" , action : None } ) ;
1862
1862
}
@@ -1895,6 +1895,7 @@ impl Channel {
1895
1895
let mut update_fail_malformed_htlcs = Vec :: new ( ) ;
1896
1896
let mut require_commitment = false ;
1897
1897
let mut value_to_self_msat_diff: i64 = 0 ;
1898
+ let funding_txo = self . channel_monitor . get_funding_txo ( ) . unwrap ( ) ;
1898
1899
// We really shouldnt have two passes here, but retain gives a non-mutable ref (Rust bug)
1899
1900
self . pending_inbound_htlcs . retain ( |htlc| {
1900
1901
if let & InboundHTLCState :: LocalRemoved ( ref reason) = & htlc. state {
@@ -1987,7 +1988,7 @@ impl Channel {
1987
1988
}
1988
1989
self . monitor_pending_forwards . append ( & mut to_forward_infos) ;
1989
1990
self . monitor_pending_failures . append ( & mut revoked_htlcs) ;
1990
- return Ok ( ( None , Vec :: new ( ) , Vec :: new ( ) , None , self . channel_monitor . clone ( ) ) ) ;
1991
+ return Ok ( ( None , Vec :: new ( ) , Vec :: new ( ) , None , self . channel_monitor . clone ( ) , funding_txo ) ) ;
1991
1992
}
1992
1993
1993
1994
match self . free_holding_cell_htlcs ( ) ? {
@@ -2000,7 +2001,7 @@ impl Channel {
2000
2001
for fail_msg in update_fail_malformed_htlcs. drain ( ..) {
2001
2002
commitment_update. 0 . update_fail_malformed_htlcs . push ( fail_msg) ;
2002
2003
}
2003
- Ok ( ( Some ( commitment_update. 0 ) , to_forward_infos, revoked_htlcs, None , commitment_update. 1 ) )
2004
+ Ok ( ( Some ( commitment_update. 0 ) , to_forward_infos, revoked_htlcs, None , commitment_update. 1 , funding_txo ) )
2004
2005
} ,
2005
2006
None => {
2006
2007
if require_commitment {
@@ -2012,9 +2013,9 @@ impl Channel {
2012
2013
update_fail_malformed_htlcs,
2013
2014
update_fee : None ,
2014
2015
commitment_signed
2015
- } ) , to_forward_infos, revoked_htlcs, None , monitor_update) )
2016
+ } ) , to_forward_infos, revoked_htlcs, None , monitor_update, funding_txo ) )
2016
2017
} else {
2017
- Ok ( ( None , to_forward_infos, revoked_htlcs, self . maybe_propose_first_closing_signed ( fee_estimator) , self . channel_monitor . clone ( ) ) )
2018
+ Ok ( ( None , to_forward_infos, revoked_htlcs, self . maybe_propose_first_closing_signed ( fee_estimator) , self . channel_monitor . clone ( ) , funding_txo ) )
2018
2019
}
2019
2020
}
2020
2021
}
0 commit comments