def maybe_add_pending_forceclose(self, chan, spender_txid, is_local_ctx, sweep_info, was_added):
        """ we are waiting for ctx to be confirmed and there are received htlcs """
        if was_added and is_local_ctx and sweep_info.name == 'received-htlc' and chan.has_anchors():
            tx_mined_status = self.adb.get_tx_height(spender_txid)
            if tx_mined_status.height == TX_HEIGHT_LOCAL:
                self._pending_force_closes.add(chan)
 we are waiting for ctx to be confirmed and there are received htlcs 
electrum/lnwatcher.py