@@ -1124,19 +1124,19 @@ impl ChannelMonitor {
1124
1124
/// Attempts to claim any claimable HTLCs in a commitment transaction which was not (yet)
1125
1125
/// revoked using data in local_claimable_outpoints.
1126
1126
/// Should not be used if check_spend_revoked_transaction succeeds.
1127
- fn check_spend_local_transaction ( & self , tx : & Transaction , _height : u32 ) -> Vec < Transaction > {
1127
+ fn check_spend_local_transaction ( & self , tx : & Transaction , _height : u32 ) -> ( Vec < Transaction > , ( Sha256dHash , Vec < TxOut > ) ) {
1128
1128
let commitment_txid = tx. txid ( ) ;
1129
1129
if let & Some ( ref local_tx) = & self . current_local_signed_commitment_tx {
1130
1130
if local_tx. txid == commitment_txid {
1131
- return self . broadcast_by_local_state ( local_tx) ;
1131
+ return ( self . broadcast_by_local_state ( local_tx) , ( commitment_txid , tx . output . clone ( ) ) )
1132
1132
}
1133
1133
}
1134
1134
if let & Some ( ref local_tx) = & self . prev_local_signed_commitment_tx {
1135
1135
if local_tx. txid == commitment_txid {
1136
- return self . broadcast_by_local_state ( local_tx) ;
1136
+ return ( self . broadcast_by_local_state ( local_tx) , ( commitment_txid , tx . output . clone ( ) ) )
1137
1137
}
1138
1138
}
1139
- Vec :: new ( )
1139
+ ( Vec :: new ( ) , ( commitment_txid , Vec :: new ( ) ) )
1140
1140
}
1141
1141
1142
1142
fn block_connected ( & self , txn_matched : & [ & Transaction ] , height : u32 , broadcaster : & BroadcasterInterface ) -> Vec < ( Sha256dHash , Vec < TxOut > ) > {
@@ -1156,7 +1156,11 @@ impl ChannelMonitor {
1156
1156
watch_outputs. push ( new_outputs) ;
1157
1157
}
1158
1158
if txn. is_empty ( ) {
1159
- txn = self . check_spend_local_transaction ( tx, height) ;
1159
+ let ( local_txn, new_outputs) = self . check_spend_local_transaction ( tx, height) ;
1160
+ txn = local_txn;
1161
+ if !new_outputs. 1 . is_empty ( ) {
1162
+ watch_outputs. push ( new_outputs) ;
1163
+ }
1160
1164
}
1161
1165
} else {
1162
1166
let remote_commitment_txn_on_chain = self . remote_commitment_txn_on_chain . lock ( ) . unwrap ( ) ;
0 commit comments