@@ -1136,19 +1136,19 @@ impl ChannelMonitor {
1136
1136
/// Attempts to claim any claimable HTLCs in a commitment transaction which was not (yet)
1137
1137
/// revoked using data in local_claimable_outpoints.
1138
1138
/// Should not be used if check_spend_revoked_transaction succeeds.
1139
- fn check_spend_local_transaction ( & self , tx : & Transaction , _height : u32 ) -> Vec < Transaction > {
1139
+ fn check_spend_local_transaction ( & self , tx : & Transaction , _height : u32 ) -> ( Vec < Transaction > , ( Sha256dHash , Vec < TxOut > ) ) {
1140
1140
let commitment_txid = tx. txid ( ) ;
1141
1141
if let & Some ( ref local_tx) = & self . current_local_signed_commitment_tx {
1142
1142
if local_tx. txid == commitment_txid {
1143
- return self . broadcast_by_local_state ( local_tx) ;
1143
+ return ( self . broadcast_by_local_state ( local_tx) , ( commitment_txid , tx . output . clone ( ) ) )
1144
1144
}
1145
1145
}
1146
1146
if let & Some ( ref local_tx) = & self . prev_local_signed_commitment_tx {
1147
1147
if local_tx. txid == commitment_txid {
1148
- return self . broadcast_by_local_state ( local_tx) ;
1148
+ return ( self . broadcast_by_local_state ( local_tx) , ( commitment_txid , tx . output . clone ( ) ) )
1149
1149
}
1150
1150
}
1151
- Vec :: new ( )
1151
+ ( Vec :: new ( ) , ( commitment_txid , Vec :: new ( ) ) )
1152
1152
}
1153
1153
1154
1154
fn block_connected ( & self , txn_matched : & [ & Transaction ] , height : u32 , broadcaster : & BroadcasterInterface ) -> Vec < ( Sha256dHash , Vec < TxOut > ) > {
@@ -1168,7 +1168,11 @@ impl ChannelMonitor {
1168
1168
watch_outputs. push ( new_outputs) ;
1169
1169
}
1170
1170
if txn. is_empty ( ) {
1171
- txn = self . check_spend_local_transaction ( tx, height) ;
1171
+ let ( local_txn, new_outputs) = self . check_spend_local_transaction ( tx, height) ;
1172
+ txn = local_txn;
1173
+ if !new_outputs. 1 . is_empty ( ) {
1174
+ watch_outputs. push ( new_outputs) ;
1175
+ }
1172
1176
}
1173
1177
} else {
1174
1178
let remote_commitment_txn_on_chain = self . remote_commitment_txn_on_chain . lock ( ) . unwrap ( ) ;
0 commit comments